When working on WordPress projects, and you need to migrate, let’s say from LOCAL to DEV, or DEV to STAGING, or STAGING to LIVE, whatever the case may be, you need to keep a lot of things in consideration.
Here’s my setup:
- SVN holds any custom themes or plugins, not the core files, or config files.
- Multi-tier environment with dropbox backing up local files. (LOCAL, DEV, STAGING, LIVE)
- LAMP dev environment.
Before you migrate, setup WordPress:
- Create an entry in the hostfile if necessary
- Setup the vhosts file
- Unzip WordPress in the new folder in all environments
Let’s go through the basic list:
- Make sure core is not in SVN. Only keep changes, and new development in SVN.
- Make a list of plugins used.
- Extract WordPress in the folder you want to install the website.
- Copy database to new database.
- Change DB URL
1UPDATE wp_options SET option_value = REPLACE (option_value,'old.domain.com','new.domain.com');
- Typically from dev.website.com to stg.website.com for staging
- And dev.website.com to website.com for live.
- Copy wp-config file to new folder if settings are the same.
- Change db login credentials.
- Do a checkout of SVN project in doc root.
- Re-install all plugins.
- Configure plugins.
This should be it. I wouldn’t mind working on a custom plugin to handle all this. Maybe add some custom code to do svn updates on the other tier levels as well, so all I would have to do is click a button, and BAM, svn updates to next level.
I might even dedicate a page for this. Standby for this feature.