Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to setup a website using wordpress, which we can modified locally and then via subversion commit the site and make it public. This means to installing new plugins, changing the content, testing updates of wordpress to see if they work with the theme, etc.

The idea is to control the development on the site, in case we need to keep track of the dev or roll back, because of unexpected bugs in a the plugins, theme, etc.

I've read this article in codex, however I'm not sure how this is done when, we want to include the content and changes on the options of worpdress and plugins (which is in the mysql).

Thanks

share|improve this question

3 Answers 3

The codex article you linked would be what you would use to install / update the master copy of Wordpress locally. You then commit your changes to the Wordpress master site to a local svn repo.

What you could look at doing is implementing a commit hook to trigger based on a value in the commit message, or maybe when you commit into a tag. The hook script could then svn export a copy to the public host. Thus pushing live without all the extra svn files/folders.

The commit hook could also trigger the DB update, from what ever method you decide on to version control it.

Some svn hook reading: http://svnbook.red-bean.com/en/1.4/svn-book.html#svn.reposadmin.create.hooks Also some stackoverflow Questions / Answers on hooks: http://stackoverflow.com/search?q=svn+hook

RB

share|improve this answer
    
+1 for this. A post-commit hook would be the mostly tightly integrated (with svn) way of pushing your changes live, especially database alterations. –  Beerey Mar 4 '11 at 2:45

To do what you want you need to:

  1. figure out how to dump the parts of the database you want into a flat file (mysqldump or mysql-hotcopy may be of help here)
  2. automate doing so with a script (which you also put in version control)
  3. automote restoring said dump into the database in a script (which also goes into version control)

Then you've got all the pieces and can pull data from the db and check it into svn or push data from svn back into the db if/when you want to restore. Make sure to test that!

share|improve this answer
    
well using custom scripts is a way.. however I'm looking at something like this codinghorror.com/blog/archives/000743.html for the db. thanks –  Geries Dec 15 '09 at 17:20

We do something similar with an automated Selenium-based integration testing system.

We have a PHP script on the server that listens for the remote call from a post-commit hook. The script performs an SVN update to update all the sources in the test environment (and then Selenium runs a number of predefined integration tests -- but you probably don't care about that).

For the database, you could call mysqldump via PHP to copy the dev database to live (automatically backing up the previous live of course).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.