Developing With WooThemes And WP Migrate DB Pro

Written by Mark Forrester on July 31, 2013 Woo news.

brad-touesnard,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.

The database migration process. Super easy.
The database migration process. Super easy.

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.

Find out more about WP Migrate DB Pro
Find out more about WP Migrate DB Pro

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…

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.

Special offer for WooThemes users: Get 20% off your purchase of WP Migrate DB Pro by entering coupon code WOOTHEMES20 at checkout (expires August 13, 2013).
cta-banner-10-product-page-v2_2x

25 Responses

  1. Brad
    July 31, 2013 at 3:38 pm #

    Who has questions? Shoot!

    • Tim Stiffler-Dean
      July 31, 2013 at 4:54 pm #

      Looks like an awesome product. Added to my list of things to buy. Do you have any plans for helping users with database versioning? Or, perhaps a better question, how do you go about managing your database versions as you use your tool for backup up and managing updates from local host to production website?

      • Brad
        August 1, 2013 at 12:45 pm #

        Hey Tim,

        There is a way to do database versioning with the current plugin. You can check off the backup checkbox under Advanced when pushing or pulling. This will save a copy of the database that is to be overwritten before it is overwritten. Before running the migration, save a migration profile. Then every time you migrate, you use the migration profile with the backup option checked off already. Then you can be sure that every time you migrate, it saves a backup to your wp-content/uploads folder first and is a sort of version control. Does that work for you or did you have something else in mind?

        Sorry for not replying sooner. I didn’t get any email notifications. :S

    • Harish
      July 31, 2013 at 10:01 pm #

      The question is.. Why have you not promoted this plugin widely. Feels ridiculous to be doing WordPress db migrations manually all this while.

    • Ashraf
      August 2, 2013 at 11:22 am #

      Hey Brad,

      What’s the difference between WP Migrate DB Pro and using a tool like the one on Interconnect/it – http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

  2. mabouchalkha
    July 31, 2013 at 4:15 pm #

    hi amazing plugin,

    please what the difference between BackupBuddy migrate database?

    • Brad
      August 1, 2013 at 12:51 pm #

      BackupBuddy migrates your entire web site, including core files, theme files, etc. WPMDB Pro only deals with the database. Another difference is that WPMDB Pro allows you to run a migration entirely from your WP dashboard. BackupBuddy requires you to upload files to your server. I think WPMDB Pro is better suited to fit into a developer’s workflow when developing sites.

  3. Sami Keijonen
    July 31, 2013 at 4:15 pm #

    So the plugin can also migrate multisites? Can I pick which site I migrate or is it always all sites.

    I’m this close to buying, it

    • Brad
      August 1, 2013 at 12:54 pm #

      Hi Sami,

      Yes, the plugin can migrate from one multisite install to another multisite install. We don’t currently support the migration of a multisite install to a non-multisite install, nor do we support the migration of a subsite from one multisite install to another.

  4. Nicolas richer
    July 31, 2013 at 5:32 pm #

    This answered to a problem I had and haven’t had the time to search a solution for… Thanks for the coupon, I just bought a Developer License !

  5. magic_al@hotmail.co.uk
    July 31, 2013 at 6:49 pm #

    This plugin looks great. I’ve used the WordPress export tool before and had to go through and find/replace the URLs. It’s a nightmare but I didn’t know a better way to do it at the time.

    I apologise if this is a newbie question, but can anyone tell me (or at least point me to a resource that explains) how to setup the dev environment like in the video. Thanks!

  6. chiseledimages
    July 31, 2013 at 8:28 pm #

    I’ve been using this plugin for a couple months now, since Chris Coyier first mentioned it on Shoptalkshow. Love it. By the far the best plugin I’ve used as far as something that has greatly increased productivity. I used to have to export out a database, then go use a search and replace tool on the database. And hope I didn’t mess it up. With I’ve effortlessly transferred many sites using Migrate DB Pro. It’s especially useful when going from my localhost environment to a live server. Well worth the little bit of investment.

  7. James
    July 31, 2013 at 10:33 pm #

    I also have been using this for a few months, and I can say that after trying lots of different approaches – this is the best.

    Just one issue: It only copies tables with the wp_ prefix. Unfortunately for me I have one site that has some extra tables in it without the wp_ prefix, so they don’t get copied (which means back to phpmyadmin).

    I did contact the developers but they didn’t want to change this. I suggested a new feature where you could select which tables to copy (as some backup plugins do)… hopefully we’ll see this at some stage.

    • Brad
      August 1, 2013 at 1:13 pm #

      Hi James,

      The next release will have the ability to select any table in the database instead of only those with your database prefix. 🙂

    • Brad
      August 1, 2013 at 1:16 pm #

      Thanks for all the kind words folks! We love hearing how it is helping. 🙂

  8. Ross McKay
    August 1, 2013 at 11:40 am #

    WP Migrate DB Pro has made a huge difference to our productivity developing WooCommerce websites. We used to do the whole manual DB dump ‘n’ edit ritual that Brad talks about, and it was painful. Now it’s a breeze to develop the site locally, dump to an SQL file ready to go onto the test or live site via phpMyAdmin, and then pull content changes back into our dev environments (two devs, so often two dev environments) when we need to test some changes.

    Simply the best software tool I’ve bought for years! Thanks, Delicious Brains!

    Now, if only that other e-commerce plugin’s dodgy transients didn’t cause WP Migrate DB Pro to crap out on transferring the options table so often (oh, how I wish those clients would let me switch them to WooCommerce!)

  9. arseneau
    August 1, 2013 at 6:03 pm #

    Hey Brad, I’ve also been using your free plugin ever since it came out. Buying the Pro version would be a no-brainer.

    But since we work as a small team, how would you see your plugin working within a team environment, where we each run our own local dev environments (some use MAMP, others localhost:8080), git for file versioning, etc ?

    • wastark
      August 1, 2013 at 7:53 pm #

      How do you keep your databases synced from individual dev to staging, or are you all running on one “group” db?

    • Ross McKay
      August 3, 2013 at 10:09 am #

      @arseneau: we are a really small team — of two! — and we keep one dev’s server as the content master during development, syncing content to the other dev’s server as needed. I do any content import coding (e.g. loading WooCommerce products and custom post types from XML export files), and I test that in my own environment, which means I can run as many import tests as I like since I can easily wipe the lot and resync with the content master. Once imports are finalised, I run the import code on the content master.

      When the site goes to a staging server where the client can add and modify content, that server becomes the content master we both sync with. Once the site goes live, the live site becomes the content master we both sync with.

  10. George
    August 4, 2013 at 5:17 pm #

    Hi Mark/Brad,

    That looks like a pretty handy tool that you’ve developed there.

    I’ll give it a go.

    Cheers
    George

  11. orgspring
    August 7, 2013 at 5:50 pm #

    Will this work if we’re backing up live sites to local sites?
    I’ve been using serverpress for local development. Also have access to Mamp Pro.

  12. Mathew Porter
    August 9, 2013 at 7:21 pm #

    The videos a great resource guys.

  13. Steven Knapp
    August 11, 2013 at 4:09 am #

    Hey Brad,

    Dude, so timely and about to save me tons of headache. Being a almost noob, I’m unsure how to handle WooCommerce product images that are currently in our dev environment. We’ve been getting every product setup in the dev area. Will WP Migrate DB Pro export product images also?

  14. YacineMerzouk
    August 25, 2013 at 1:23 am #

    I started using WP Migrate DB Pro – it’s the complement to Git I need to really work on WP stuff offline then deploy to production sites with confidence.

WooCommerce - the most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment
%d bloggers like this: