Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

If I read the question correctly, your production instance is 1.7, while your testing instance is 1.4.

Really, the only solution is to upgrade your testing instance to 1.7 as well. This way, the database structures are the same. By upgrading and upgrade using your current test instance database, you'll keep the CMS & Categories you created. Once the upgrade is complete, you can export the orders over as well.

This may seem time consuming, but in my opinion, is the only feasible way to move forward.

Also, you should consider to setup a version control system as well. This way, you can easily merge your changes in testing to production.

You cannot migrate the data between schemas as they have changed so radically. Export via Dataflow / API and reimport.

The preferred method is to run your upgrade in-place on your live staging site. Have recent (tested as working) backups available and, if possible, use the maintenance.flag to stand up a page to use in the meantime that will notify customers of the downtime.

Edit:

As @kab8609's answer details it sounds as if you upgrade your live site ahead of your staging site. Aside from being a risky move, it's also bad practice. You should document your schema changes as you will need to reperform them again at upgrade time.

You should bring your production instance down to staging, replace it in full. In the future, be sure to pilot your upgrades on your staging site prior to your production site.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top