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.

What is the process to migrate WooCommerce customers and orders from site to site?

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

Make sure to migrate your customers before migrating your orders. How come? Each order is mapped to a single customer. If the customer has not been migrated yet, the order cannot map to that customer. This is especially important if you are merging customers and orders between sites and you want your customers to keep their same password.

What plugins do we need to do this?

Below are the following plugins to use in your migration:

Yes, I know these are paid plugins but I tried a lot of free and other paid plugins and was not able to successfully migrate my orders without the two plugins above.

Not only will these plugins save you a lot of time and headaches in the migration process, but will also 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”.

woocommerce-migrate-customers-csv-export-settings

Step 3

Then, go to Settings, toggle Customers, and select the dropdown to CSV Import and click “Save Settings”.

woocommerce-export-customers-csv-import-save-settings

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.

woocommerce-export-customers-download-csv-file

My exports freeze without completing. How do I fix this? If you exports freeze without completing, ensure that your site is not blocking HTTP requests.

Before proceeding to part 2, do a quick check of your customers CSV file.

The first 3 columns should be username, email, and password.

If the first 3 columns are customer_id, first_name, and last_name you did not export your customers from Site A using the “CSV Import” export format method (reminder, we completed this in step 3 above).

Correct

  • username
  • email
  • password

Wrong

  • customer_id
  • first_name
  • last_name
woocommerce-export-customers-csv-file-username-email-password

This is how the first 3 columns of your customers CSV file should look like

Here is a sample CSV file if you want to be certain you are following the directions: sample customers csv import

If your CSV file is correct get ready to import your customers from Site A to Site B in part 2!


2. Import Customers from Site A to Site B

Step 1

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

Step 2

Next, on your WordPress dashboard hover over WooCommerce > click “CSV Import Suite”.

woocommerce-migrate-customers-csv-import-suite-settings

Step 3

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

woocommerce-migrate-customers-between-sites-import-customers

woocommerce-import-customers-csv

Step 4

Finally, toggle settings based on the customers you import and click “Next”.

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.

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

Pro tip: the first 3 columns of your CSV file should be username, email, and password. 

migrate-customers-between-sites-column-mapping

After confirming your mapping is setup correctly, scroll down and click “Dry Run”.

import-customers-dry-run

Running as a “Dry Run” will allow you to see how the data is interpreted before running the import.

If you make a mistake, you can always restore to the previous backup point.

When everything is ready to go, click “Run a live import now”.

import-woocommerce-customers-run-live-import

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

In part 3, we will be exporting your orders from Site A.


3. Export Orders from Site A

Before exporting your orders from Site A, ensure that the SKUs on each product (and product variation if any) on Site A match the products on Site B.

Step 1

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

woocommerce-migrate-customers-csv-export-settings

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.

Step 4

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

woocommerce-export-orders-download-csv-file

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

In part 4, we will be importing orders 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!

In addition, download and activate the Disable Emails free 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 customers. 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!

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

Step 1

First, navigate to Site B and on your WordPress dashboard hover over WooCommerce, click “CSV Import Suite”.

woocommerce-migrate-customers-csv-import-suite-settings

Then click “Import Orders”.

woocommerce-import-orders-between-sites

Step 2

Next, upload your Orders CSV file, click “Next” and configure the options.

import-woo-orders-options

When finished, click “Next”.

woocommerce-import-orders-settings

Pro tip: If your product SKUs have changed and want to import products with an updated SKU, open up your Orders CSV file, and run a search and replace on the product SKUs that have been updated before importing your orders.

Step 3

Then, make sure your Orders CSV file is mapped properly.

Even if you’re not merging orders, skip the first column “id” in the file mapping.

import-orders-file-mapping-skip-order-id

The first 3 columns imported should be:

  1. id
  2. order_number
  3. order_number_formatted
  4. created_at

When finished, click “Next”.

Step 4

Finally, click run as a “Dry Run” and if everything went smoothly, click “Run a live import now”.

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

Pro tip: make sure to deactivate the Disable Emails plugin after completing the migration process. You want new orders to be able to receive email confirmations!


Video Tutorials

Migrate Customers and Orders (Example #1)

Migrate Customers and Orders (Example #2)

How to Export Customers?

How to Import Customers?


Frequently Asked Questions

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) plugin or Sequential Order Numbers Pro plugin (paid) plugin 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.

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 IMPORTING the “id” column since this will be auto-incremented when importing to Site B.

My exports freeze without completing. How do I fix this?

If you exports freeze without completing, ensure that your site is not blocking HTTP requests. For example, if you are on a staging site and users have to enter a username and password before entering the site, disable this on your staging site server to allow exports to process.

woocommerce-customers-orders-csv-export-freeze

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 can I reformat my CSV file before importing my orders into Site B (Step 4)?

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).

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”

I do not use a premium managed WordPress 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.

If you are looking for a high quality WooCommerce hosting provider I would highly recommend Kinsta. I just switched our site to Kinsta and our site is a lot faster than it was on WP Engine. One of the reasons is that every site on the Kinsta platform runs in an isolated software container, meaning you don’t have to worry about your performance with other websites that are on the same server as you. Kinsta also has a great blog with a ton of WordPress and WooCommerce related resources.

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.

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”.

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.

Do you have a tutorial on how to Migrate Shopify Orders & Customers to WooCommerce?

Yes, please see this blog post here: How to Migrate Shopify Customers and Orders to WooCommerce.

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.

Additional Resources

Note: links in this post have affiliate links where applicable.

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!

  5. Wesley October 24, 2019 | 7:34 am

    Thanks for this post. I was experiencing some import issues and your post cleared it up for me. Many thanks.

  6. Sue December 9, 2019 | 6:32 pm

    Are the customers without usernames and passwords Woocommerce guest accounts? Do i remove those before importing customers?

    • Simon Gondeck December 9, 2019 | 7:02 pm

      You can remove them before importing the customers. I usually open up the exported customers CSV file into Google sheets and then remove the rows that have customers without the usernames and password columns. When you import your orders, the users without customer_user will default to guest accounts. Does this make sense?

Leave a reply

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