views:

104

answers:

2

I have basically three environments that I use to work on my main site. I have my local one on my computer and the development and live ones on my web server. I developed the site using Wordpress on the local environment and want to keep everything up to date via svn.

What would be the best way to do this since I need three installs of WP on each environment? Since all the files are going to be the exact same from the repository on all three environments, how do I handle the different WP settings and configurations? Is there a way to copy the WP database from the local to the other two and make some small changes to fix URLs and other differences due to the different domains?

Sorry if this is unclear, I will clarify once I get some responses.

+1  A: 

Is it just the files you want to keep or the data, as in the blogs and comments?

If you want to keep the actual content, you will also need to do livesite database backups. Otherwise keeping track of wordpress files is pretty simple. You just need to backup the files from any themes you have added or edited and the configuration file, of which Wordpress provides a copy anyway.

Evernoob
+1  A: 

Usually, (if you're a good developer) the URLs aren't hard-coded in any plugins or themes, and all that depends on the root URL can be easily changed like:

update wp_options set option_value='http://live.wordpress.com/' where option_name in ('siteurl', 'home')

The tricky thing is updating content, that can contain domain specific stuff (like if you copy-paste addresses for links from address bar etc). But again the solution is pretty simple - go through the dump and replace "http://dev.wordpress.com' with "http://live.wordpress.com". So moving the database is not so complex task as it seems ;)

disjunction