How To Migrate Woocommerce Customers and Orders (Like A Pro!)

WooCommerce
How To Migrate Woocommerce Customers and Orders (Like A Pro!)

How to move customers and orders in Woocommerce from one site to another?

In this guide, you will learn how to successfully migrate Woocommerce customers and orders between sites without changing the customer’s password or over writing existing orders and post IDs.

Whether you need to move a few or thousands of Woocommerce customers and orders between sites, you are in good hands!

Remember to stay patient, take backups after each step, and practice on different staging sites if need be.

The process to migrate Woocommerce customers and orders from site to site are:

  1. Export Customers from Site A
  2. Import Customers to Site B
  3. Export Orders from Site A
  4. Import Orders to Site B

What plugins will we need?

Yes, I know these are paid plugins but will save a lot of time and headaches in the migration process and ensure that your customers and orders are moved correctly.

Let’s begin!

1. Export Customers from Site A

Step 1

First, go to Site A and upload and activate the Customer / Order CSV Export plugin.

Step 2

Next, on your WordPress dashboard, hover over Woocommerce and click “CSV Export”.

Step 3

Then, go to Settings, toggle Customers, and select the dropdown to CSV Import and Click Save.

woocommerce-customer-export-csv-import-format

Step 4

Finally, go to CSV Export tab, toggle Customers and click “Export”.

woocommerce-export-customers

When the export is completed, navigate to the “Export list” tab, and download your CSV file.

In part 2, we will importing the customers CSV file from Site A into Site B.

[Video] Export Woocommerce Customers from Site A


2. Import Customers from Site A to Site B

Step 1

First, go Site B and upload and activate the Customer / Order CSV Import Suite plugin.

Step 2

Next, on your WordPress dashboard hover over Woocommerce > click CSV Import Suite plugin.

Step 3

Then, click “Import Customers”, upload your customers CSV file, and click Import.

woocommerce-import-customers-without-changing-password

Step 4

Finally, ensure all fields are mapping correctly to the columns.

For example, if a customer does not have a shipping address set, I toggle to use their billing address.

In addition, since we exported the customers using the CSV Import format in Part 1, the user passwords are correctly hashed and do not need to be re-hashed.

woocommerce-import-customers

If you are importing customers that could be on Site B already, make sure to check Merge/update.

During this process I always do a “Dry Run” first to see how the data is interpreted. If I make a mistake and I can always restore to the previous backup point.

Pro tip: the first column should be username. If you see the first column as user_id, you did not export your customers from Site A using the “CSV Import” export format.

When everything is ready to go, run as a live import.

Congrats! You have migrated your customers from Site A to Site B.

In the next part, we will be migrating  your orders from Site A to Site B.

[Video] Import Woocommerce Customers to Site B


3. Export Orders from Site A

Step 1

First, go back to Site A. On your WordPress dashboard, hover over Woocommerce and click “CSV Export”.

Are you only importing/exporting Woocommerce orders? If you have not done so already, the first step is to purchase, download and activate the Customer / Order CSV Export plugin on Site A.

Step 2

Next, go to the Settings tab, toggle Orders, and select the dropdown to “CSV Import” and click “Save Settings”.

img-moving-orders-in-woocommerce

Set the Order Export Format to “CSV Import”

Step 3

Then, click the “Export” tab, ensure the export is toggled to Orders and click the Export button.

img-moving-orders-in-woocommerce-2

Keep all default statuses unless you have a specific periods or order statuses you are looking to export.

How long does it take to create the exported CSV file? If you have more than 1,000 orders, expect this to take up more than 15 minutes.

Step 4

Finally, when the export is done, click the “Export list” tab and download the exported Orders CSV file.

click the “Export list” tab and download the exported Orders CSV file

The next part is to import the Orders CSV file from Site A into Site B.

4. Import Orders from Site A to Site B

Before importing your orders, I would highly recommend taking a backup of Site B!

Step 1

First, navigate to Site B. On your WordPress dashboard, hover over Woocommerce and click “CSV Export”.

Are you only importing/exporting Woocommerce orders? If you have not done so already, the first step is to purchase, download and activate the Customer / Order CSV Import Suite plugin on Site B.

Step 2

Next, on your WordPress Dashboard on Site B, hover over Woocommerce > CSV Import Suite > click “Import Orders”.

Pro tip: Before importing your orders, download and activate the Disable Emails plugin. This plugin stops emails from sending on your WordPress server! This is beneficial when you import the orders to Site B as it blocks email notifications to send to your historical customer orders. I have made this mistake by not utilizing this plugin and have have sent over 5,000 order notification emails to past customers from orders 5 years ago!

Step 3

Then, upload your Orders CSV file and configure the following options:

  • Allow unknown products: If you have products or product variations that have been discontinued, check “allow unknown products”.
  • Merge/update: I only do this if I do not format the dates correctly or added line items to a single order and want to update the order.
img-moving-orders-in-woocommerce-5

Check “Allow Unknown Products” if you have products that have been discontinued.

Step 4

Finally, run a Dry Run and if everything went smoothly, complete the import process.

Congratulations! You have migrated your orders and customers from Site A to Site B!

See the Youtube video below for a live look at me migrating orders between sites.


Frequently Asked Questions

How do I migrate orders for “guest” customers?

To export/import customers who created orders as a guest user, ensure the following 3 things are occurring in your customer and order CSV files:

1) Customers CSV file: if a guest customer, leave the “username” and “password” field blank. By default, if “username” is not provided, the order will be marked as a guest purchase.

woocommerce-migrate-guest-customers

Leave the “username” and “password” fields blank for guest customers

2) Orders CSV file: if a guest customer, leave the “customer_user” field blank.

Leave the “customer_user” field blank for Guest customers.

3) In Woocommerce > Settings > Accounts & Privacy, ensure that “Allow customers to place orders without an account” is checked.

woocommerce-migrate-guest-customers

Check to “Allow customers to place orders without an account”

How do I keep my order numbers the same during migration?

If you want your migrated orders to keep the same order number for each order, download the Sequential Order Numbers plugin (free) on Site A before exporting your Orders and Site B before importing your Orders.

Every post on a WordPress site has a unique, auto-incremented post ID. This is also why your order numbers are not sequential by default: the order number typically equals order ID; this ID is pulling from a counter that’s also incremented each time a product, blog post, page, or other content is added.

Ensure the first and second columns are order_number and order_number_formatted and NOT including order_id since this will be auto-incremented when importing to Site B.

woocommerce-sequential-order-numbers-plugin

Download the Sequential Order Numbers plugin on Site A and Site B.

Ensure the first and second columns are order_number and order_number_formatted and NOT including order_id since this will be auto-incremented when importing to Site B.

I do not use a premium host such as WP Engine or Kinsta. How can I easily create a backup with a plugin?

A few plugins to use are BlogVault, BackupBuddy, or Updraft Plus.

How come you wouldn’t just copy the live site to the dev site? Wouldn’t all orders be migrated?

If you are developing an entirely new theme I prefer to start with a fresh WordPress install, develop the theme, and then re-import the products, customers, coupons, and then orders.

How do I migrate Woocommerce Subscriptions?

The Customer / Order CSV Export plugin downloaded in Step 1 of this tutorial will export all “regular” orders as well as parent and renewal orders of “Subscriptions”.

However, the CSV Export plugin will not export the “Subscriptions”. For example, after migrating your orders, your Subscriptions tab will be empty, even though you imported subscription parent and renewal orders.

migrating-woocommerce-subscriptions-blank

To migrate Subscriptions (not parent or renewal orders associated with each subscription), I recommend using the Woocommerce Subscriptions Importer/Exporter extension.

What would be a scenario where I would re-hash the user passwords when importing customers to Site B?

If you are importing customers that previously did not have account on Woocommerce, you would enable this option. Your CSV file for the “password” column would be plain text passwords that are not hashed.

For example, the password column would have passwords that look similar to “Holiday20” or “password123”.

Can I migrate one customer and one order before migrating everything at once?

Yes! A good way to minimize any trouble in migration is to export one customer, import one customer, export one order (belonging to that customer), and then importing that order. If everything went well during the single customer migration, I then migrate all customers and orders.

Single order import
If I have 10 or 100,000 orders to import, I always import a single order to minimize any trouble in migration.

Note: after the single order has been imported, navigate to Woocommerce > Orders > and study the single order to ensure everything migrated correctly.

All orders import
If the single order import went well, repeat the steps above and import all orders into your site.

How long will it take for my customers or customers to export or import to the list?

This can anywhere from 5 seconds to 30-45 minutes depending on how many customers and orders you are exporting or importing.

How can I reformat my CSV file before importing my orders into Site B?

For example, you may want to update the status column of your Orders CSV file before importing. These orders may now have the orders status completed but previously were processing or on-hold. If any orders need to be updated from “on-hold” to “completed” or from “processing” to “completed”, do the following:

  1. Highlight Column D > click Edit > click Find and Replace.
  2. Find “on-hold”, replace all to “completed”.
  3. Find “processing”, replace all to “completed”.

After your CSV file is ready to go, go to File > Download As > Comma-separated values (.csv, current sheet).

Additional Resources

Comments

  1. Wesley Townie April 25, 2019 | 9:19 am

    Hey Simon thank you for this post! Can you explain more why you removed the “id” column from the exported CSV file when importing the orders into the new site?

    • Simon Gondeck May 1, 2019 | 3:18 pm

      Hi Wesley, happy to help. The reason I removed the “id” column in the CSV file is that if you are moving orders from one site to the other, the post IDs could differ and thus . The post ID in WordPress is auto incremental and all posts (i.e. pages, blog posts, orders, etc.) on the site use the post ID, not just orders. By default, WordPress will not overwrite existing post IDs, meaning that if you attempt to import an order that has an existing post ID that differs from the order being imported, your order will not get imported. Did my explanation help? I realize this can be confusing.

  2. aaron May 25, 2019 | 11:00 am

    Hi Simon.

    Very helpful tutorial, though before I give it a go, can you elaborate if I need to import the products?

    Have had a go with another tutorial in the past and whilst I got the orders over, they didn’t link up to any products, so it showed the orders, but didn’t link to products, so we couldn’t do follow up emails or see data on products sold.

    Would it be advised to import all the products first so that the orders show the products purchased?

    Thanks again.

    • Simon Gondeck May 25, 2019 | 4:23 pm

      Hey Aaron: Yes you are correct! Import the products first before importing your orders. Order items can be mapped to the products via SKU or product_id. I would recommend importing the products first (you can ignore the product_id column), and then importing the orders after. Doing so this way will allow the items in each order to be matched with a specific product by SKU. Does this help? Let me know if can answer any other questions or help.

  3. Caitriona Butler June 19, 2019 | 10:01 am

    Hi Simon,
    Thanks for a great post.
    I will potentially need to migrate Woocommerce data for a site that also uses the ‘WooCommerce Subscriptions’ plugin. Would that add any steps to the ones listed above? Or is the Subscription data held with the Orders data?

    • Simon Gondeck June 20, 2019 | 7:18 pm

      Hi Caitriona, the Woocommerce CSV Export plugin will export all “regular” orders as well as parent and renewal orders of “Subscriptions”. However, the CSV Export plugin will not export the Subscriptions. To migrate Woocommerce Subscriptions (not parent or renewal orders associated with each subscription), I would recommend using the Woocommerce Subscriptions Importer/Exporter extension.

      If exporting/importing Woocommerce Subscriptions using the extension above, I would recommend to do the following:

      • Not using the customer_id column and instead formatting the CSV file and adding either the customer_email or customer_username column to avoid overriding post IDs if migrating historical subscriptions.
      • Ensure that the order_items are either the product id or specific variation id.

      Overall, this is a complicated process to migrate both orders and all subscription data. This is something I could assist with if you send me a email to simon[at]sgwebpartners.com with more details.

      Cheers!

  4. Fernando June 27, 2019 | 2:34 am

    Hi Simon. Thanks for sharing your experience with orders migration. I have tried the steps you mention and all seems to work except for one thing that is very important in my case. The orders numbers are not kept as they are in the csv file and they are replaced with new website default order numbers. Did you ever experience this? Any suggestion on what could be the cause and solution to this. Thanks anyway for sharing your article and video.

    • Simon Gondeck June 27, 2019 | 9:47 am

      Hi Fernando, every post on a WordPress site has a unique, auto-incremented post ID. This is also why your order numbers are not sequential by default: the order number typically equals order ID; this ID is pulling from a counter that’s also incremented each time a product, blog post, page, or other content is added.

      A solution is to download and activate the WooCommerce Sequential Order Numbers plugin on both sites. For example, on Site A before exporting your orders, install and activate Sequential Order Numbers plugin > then export your orders. On Site B, before importing your orders, install and activate the Sequential Order Numbers plugin > then import your orders. I added a screenshot under this question in the Frequently Asked Questions section to import your orders file with the first and second columns as “order_number” and “order_number_formatted” and not including “order_id” since this will be auto-incremented when importing to Site B.

      Does this make sense? Let me know!

Leave a reply

Your email address will not be published. Required fields are marked*