2

I need to export/import all WooCommerce orders from a clients old website to their new website. We basically took their website, redesigned it but the install and everything is the same - besides there being two versions and both are on different servers. We tried replacing postemta and posts but that messed up EVERYTHING, like the pages, menus, etc.

We are on a tight deadline (every moment is crucial) and we need help on this. We are aware of the plugins, but if there is a dirty way to do it we are open to it.

To reiterate: we need to move just the orders from one site to another without messing everything else up.

Thanks in advance!

closed as off-topic by Pieter Goosen, cybmeta, Mark Kaplun, TheDeadMedic, kaiser Mar 6 '15 at 16:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

4

The reason copying those messed up your site was probably because of id mismatches. That is, posts with the ids of the stuff you're importing already exists.

Regardless, since woocommerce stores orders as a custom post type, your safest bet here is probably the built in wordpress post import/export tool.
1. In the wordpress backend for the old site select Tools->Export
2. Choose "Orders"
3. Download the export file.
4. In the wordpress backend for the new site select Tools->Import
5. Click "Wordpress" (install the plugin if you need to).
6. Choose/Upload the file you created in step 3.

If you need to do this through SQL for some reason, the place to start will be with
SELECT * from wp_posts WHERE post_type='shop_order'
Then you'll need to export the result of that query and increment all of the IDs by whatever the auto increment value is on the new table. But that will give you a pretty messy table...

  • Very useful tip! I was searching for external plugin while this functionality already comes with Wordpress. Thanks a lot! – Forza Feb 8 '16 at 18:26
  • 1
    @GentlemanMax This method doesn't import the linked products. In orders list, we see 0 items against imported orders - any clue on that? – Riz Mar 24 '16 at 9:46
  • @eFriend, I haven't run into this personally so I'm not sure. I would guess that linked products are stored in the database as a separate table and that is why they don't come over. If I was doing this, I would use a mysql query to grab the linked products and then use a second query to import them into the other database. It probably uses post_id to correlate the tables so you would need to correlate the old and new post_ids (probably using the slug). – TheGentleman Mar 25 '16 at 12:26
  • That's correct @GentlemanMax - Another manual query to import products linked with orders were required. It was tough effort keeping in-view that live site was continuously adding more orders – Riz Mar 31 '16 at 14:29

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