This is a guest post from Brad Touesnard, founder of Delicious Brains — a company building super awesome products for WordPress including the critically acclaimed time-saving developer tool WP Migrate DB Pro.
Let’s say you launched a site for a client a couple of months ago. It’s a store built on WooCommerce and the Canvas theme. The client has added hundreds of products to the site and has been blogging every couple of days. The site has received over ten thousand visitors and dozens of sales and comments. Now your client wants a new feature added to the site. You’re ready to get started developing, but first you need to update your development environment with the media files and data from the live site. You download the media files easy enough, but how do you update your local database?
Maybe you use the WordPress XML export tool. But that doesn’t actually export all your data. Some of the WooCommerce and Canvas settings have changed on the live site, but are not included in the export. So you have to go through your settings on the live site, compare them with the local site, and make sure they all match up. Yuck! Time consuming and mundane work. Not to mention you’ll have to do this again the next time you update your local environment.
Instead, you could export a copy of your database (as an .sql file) using phpMyAdmin or the command line, run a find and replace on it to update URLs and file paths, then import it into your local environment using phpMyAdmin or the command line. But oops, looks like your widgets didn’t get migrated. Turns out they are stored as serialized data in the database and the find and replace corrupted the serialization. So now you have to setup all the widgets again manually, copying and pasting from the live site.
This is exactly what I used to do. And it sucked, so I came up with a solution.
In 2009, I released a new plugin on WordPress.org called WP Migrate DB. It allows you to run a find and replace as your data is exported and handles any serialized data. So you end up with an .sql file that you can easily import using phpMyAdmin or the command line. This saves a lot of time and cuts out all the painful work of manually copying content and settings over from the live site. But it could still be better. What if you could copy your database from one WP install to another without leaving the WP dashboard at all, eliminating the step of importing with phpMyAdmin or the command line? That would be awesome.
Well, that’s exactly what we set out to build in December last year. It was a challenge to say the least, but after approximately 800 hours of development and testing, we released a pro version of WP Migrate DB that can push or pull your database from one WP install to another. We ended up also including the ability to select which database tables you’d like to migrate, support for multisite, a promise of more frequent updates, and email support.
To market and sell the plugin we had to build an ecommerce website. We looked at a couple of different options around WP and settled on WooCommerce as it seems to be the most mature and had the most mature addons that we needed:
Although we had a to do a bit of development to make the Software and Subscriptions addons play together nicely, that was it really. Everything else just fell into place. We were very impressed with WooCommerce. It was a pleasure to work with.
When I was setting up the website on the live server, I used WP Migrate DB Pro to push the database. I had done this plenty of times during testing, but this was really the first time that it had saved me from the manual drudgery of migrating the database. It was really exciting. Unlike the WordPress XML export tool it migrated all my data, including my WooCommerce settings. It saved a bunch of time but more than that it took the pain away.
Exporting a database, fiddling with the data, and importing is no fun. So being able to just hit a button and watch as it does all this mundane work for you is exciting. But don’t just take my word for it…
— Pippinsplugins (@pippinsplugins) April 18, 2013
— Jonathan Christopher (@jchristopher) April 16, 2013
The following is a short screencast showing how we use WP Migrate DB Pro to update our local development database before starting work on deliciousbrains.com, our WooCommerce powered website.
Whether you work with WooCommerce or just build sites using WooThemes themes, your development workflow with be much more pleasant with WP Migrate DB Pro.
Have you already been using WP Migrate DB Pro in your development? How’s it working out for you? Let us know in the comments.