Full Blog Post

Database Synchronization: From Development To Production Server

I am taking some time to write code for my blog that will synchronize my database from my development to production server. The way how it works is every time I write a new blog article, an article is stored in my development server. To push changes to my database that is stored in my production server, my administration panel simply connects to the database in my development server, gets the data from there, connects to my production server, and copy the data to the database. If I edit my post or delete the data stored in my development server, the changes I made can be manually pushed to the database in my production server.

This will take some time as writing code that synchronizes my development database with my production database can be tedious as I don't want to mess up my production server if something goes wrong. That's why I have a virtual machine setup for testing database synchronization before I begin to synchronize my development database with my production server. I asked my question over at Stack Overflow and provided my answer which describes how the process will work once it's done. I also talk about how I am using a solution that drops and recreates all the tables along with importing all the data into the database. While this is a quick-and-dirty solution, the use of mysqldump and mysql command for exporting and importing the database is inefficient once my blog gets larger and larger.