Magento – How to sync Database between live and test system, when scheme has changed (How to export orders)

ce-1.4.1.1ce-1.7.0.2databaseupgrade

I have upgraded Magento CE from 1.4.1.1 to 1.7.0.2. Between this versions the database scheme has changed.

This means, i can't easily export the database from the live system to the test system. And i had to change a lot of things in the cms and category settings of the test system. This data is stored in the database and I'd like to keep it.

Is there a possibility to export the orders from live and import them to the test system? This would probably solve my problems. I have consulted google extensively, but was not able to find a solution.

Best Answer

Your main problem in this whole scenario is that you need live data (orders and history). Magento's import/export mechanisms do a reasonable job on basics like product and customer account data, poorly or not at all on categories and sales data (orders, invoices, etc), the latter being your interest.

Assuming you meant in your description that your live server is 1.7.x.x and your test is 1.4.x.x

Test your backup abilities, you will need to know if this works sooner or later.

Tar your application and backup your database on the live server.

Empty everything off the test server and clear all the tables in the database.

Restore your application and database to your test server, set file/folder ownership and permissions, change your baseURLs and make local.xml changes. Instant update of your test server from 1.4.x.x to 1.7.x.x

Reapply your changes to take it back to the configuration you had.

Now, if you're going in the other direction (1.4.x.x on the live and 1.7.x.x on the test), do all the above and then upgrade your test server to the new version. It will ensure you have done the upgrade several times before the final upgrade to the live server. You will have worked all the kinks out and the live upgrade goes a lot smoother that way. Reapply your changes to take it back to the configuration you had.

It truly is easier this way, all that import/export pie-in-the-sky goofiness recommended for version upgrades over on the MagentoCommerce forums and Wiki is a recipe for disaster and membership in the local looney bin. Nobody working with live ERP software puts up with the added complexity for the incomplete results it delivers.

IMPORT/EXPORT UPGRADES ARE THE REAL LIFE EXAMPLE OF "WORK HARDER NOT SMARTER".

Plus, being really good at doing site restores on a separate server banishes the adrenaline freeze, panic and heart attack you have when your site goes up in smoke without current backups. Keep current backups with a tested restore routine and it probably won't happen, but you know what to do if it does.

NOTE: And start by doing a full backup on your test system.

Related Topic