Best way to migrate the database from local to live and vice-verca

I've always kept a 1 way workflow in which I pulled my DB to my local development environment and pushed theme and plugins to the live site. The reason for this is that I didn't want to overwrite any changes my users made on the live sites.
I'm to a point now where I'd really like to develop a project or make necessary updates to client sites on my local environment and push the whole works to the live site when its complete. The problem is that I only know enough about mySQL to be dangerous. I'm not confident that I know the best way to import/export my DB without overwriting changes I've made locally or changes that a user has made (that I have no way of knowing were made).


  • PC
    • WPMU DEV Initiate

    Hey there Eric,

    Thanks for posting on the forums.

    I found this nice article here :

    It will help you create a local-live sync with Version control.

    Please note that it will require a bit of testing and reading so make sure you do not try it on a live site.

    Apart from that my colleague Jack has also given a good advice here : so you can go through that as well.

    I hope that helps. Please feel free to ask if you have more questions on the same.

    Cheers, PC

  • EcomEric
    • Site Builder, Child of Zeus

    The advice Jack gives is an automated way of doing what I already do. I had already looked into this option... If you look at the FAQ for Migrate DB Pro they clearly states that they currently can not handle merging of databases, it is strictly a drop/add function.

    The tuts+ article also does not deal with the issue of merging. I've had a if/else conditional set up for my wp-config databases for a long time. Adding version control doesn't alleviate the issue of conflicts. Per the article in question regarding conflicts...

    ...A typical scenario is when you are working and committing to your local version, and someone (online) is adding new content to your blog. I can’t help in this situation, you need to learn about Mercurial (or your revision control system) merging and team work.

    My problem is not getting the data back and forth, its a matter of getting my local data to my server w/o overwriting my users work, or overwriting my development work when pulled to local.

    I'd greatly appreciate a more in depth look at resolving my issue. I'm perfectly capable of using on my own.


  • PC
    • WPMU DEV Initiate

    Hello there Eric,

    Thanks for posting back and clarifying it even more. I could not find anything else apart from this neither in my resources or Google.

    I have however asked my colleagues @Jack Kitterhing and @Patrick Cohen to chime in so that we can discuss it and find a better solution !

    They should be around soon.

    Cheers, PC

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.