I have upgraded Magento CE from to 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.

  • 2
    You don't. You upgrade your live site in-situ (ie. again) May 15, 2013 at 8:05
  • I can't because on the test system the categories have changed. I added another view to get another language running. I had to change a lot of cms because i had to switch from two column layout to three column layout etc... I have to keep a big part from the test database. But i need all the orders from the live system.
    – Darokthar
    May 15, 2013 at 8:53
  • 3
    Just don't bother. You can hack your way through exporting orders/customers and importing it into another store. But at the end of the day - your DEV and LIVE environments are separate. Whatever you do in one, you must do in the other. Just re-created your categories and store view. May 15, 2013 at 9:52
  • @sonassi - Been there, attempted that and the cheap teeshirt wasn't worth the effort. Thanks for being the voice of experience. The perceived hard way is not the easy way and the perceived easy way leaves you a database resembling Swiss cheese with nasty needles sticking out. May 25, 2013 at 17:48

3 Answers 3


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.


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.


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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.