Syncing magento database froms development to production

Posted by ringerce on Stack Overflow See other posts from Stack Overflow or by ringerce
Published on 2012-09-07T20:02:02Z Indexed on 2012/09/09 21:38 UTC
Read the original article Hit count: 252

I use git for version control. I have a development, staging and production environment. When I finish in development I push to staging for review by the client. When approved, I push changes from staging to production. That works fine as long as there is no database changes. What happens if I install modules via Magento connect on local development and it makes database modifications.

How would I push those changes up to the production server since the production server is always changing?

Edit:

I wrote two shell scripts. One that pulls the production database down to my development server, replaces base url with develpment url and updates my development db accordingly. It also leaves the production sql dump behind to be added to my git repo. I'm not really sure if it's beneficial to keep the raw dumps in source control but I'm going to try it out. The second scripts moves the development database up to staging and essentially performs the same operations as the first.

Now when it comes time to move to production I pull the updated production repo into the production server and allow magento to do it's thing. I also started using SQLYog recently and it has a database comparison wizard which will give me the differences in my development and production databases and allow me to merge the changes in selectively. It always creates a migration script that I added to source control as well. If anything goes wrong I can run the comparison to see if anything was missed.

Does this sounds like a decent workflow to you guys?

© Stack Overflow or respective owner

Related posts about database

Related posts about git