When you are migrating data from a WooCommerce website to another new WooCommerce website.
In the old WooCommerce website, the data that you have are the users, products, and the orders that the users place. When migrating to a new website, the one thing to take extreme care of is to maintain the relationship between these data.
But before any of the migration that happens, be sure to keep a backup of all the data on either website. Not keeping a backup of all the data in your website will put you in the risk of losing or corrupting your data irreversibly and you might have to do all the work in your website all over again.
How to Migrate Data From One Site to Another?
The best and easiest way to migrate these data is to export the data to CSV file and then import the data in the CSV file to the target site.
WooCommerce plugin allows you to export products from your existing site and then import the CSV file to the target site. You can export and import products with the WooCommerce plugin itself. On the products page, there are two buttons on the top of the page that can help you import to or export the products from a WooCommerce store. But the options that it provides is limited. There is less amount of flexibility and control on the product data that are exported or imported into a CSV file when importing using the WooCommerce plugin.
When importing and exporting to a newly developing site a major thing to take care of is the order in which the data are imported. Follow the steps and the order while importing the data to a newly created site.
Step 1: Import and export the users
To import and export users from one website to another, install and activate WordPress Users and WooCommerce Import Export Plugin on both the websites, on the website from which the data is to be migrated and the target website.
Read the documentation on how to set up WordPress Users and WooCommerce Customers Import Export Plugin to help you get started with the plugin with ease.
From the source website, export all or the required user data into a CSV file. WordPress Users and WooCommerce Import Export Plugin will help you export all the data and its metadata into a CSV file. With the plugin, all you need to do is go to the admin side and on the WordPress Users and WooCommerce Import Export plugin page. Then, give all the specification about the data and how you want the data to be exported and then export the data to a CSV file.
Now you will have all the required data that you need to import into the new site in a CSV file, take it to the target site. From the target site, import all the users from the CSV into the target site.
This will create the users on the new site. And since there are no other posts on the site, the user data will retain the original user ID and you don’t have to worry about users being imported to be assigned a different ID or skipped from importing.
Step 2: Import and Export Products
From the source site, export all or the required products of the site into a CSV file. One of the best plugin to export and import the plugin is the Product Import Export Plugin for WooCommerce. This plugin allows you easily export and import all products and product types from one store to another.
Install and activate the plugin on the website and from the admin side of the website, go to the Product Import Export plugin, configure how you want to import the products and then import the products into a CSV file.
Export Page for Product Import Export Plugin for WooCommerce
You can read about how to set up the Product Import Export plugin for WooCommerce plugin here.
Now that you have all the product data that you want to import in a CSV file, head over to the target site and using Product Import Export Plugin for WooCommerce, import the CSV file into the newly created website.
After importing the file, you will get all the products and its metadata in the new WooCommerce store.
Step 3: Import and Export Orders
After all the users and the products have been imported into the new WooCommerce store, now it is safe to transfer the orders to the store. The Order/Coupon/subscription Export Import Plugin for WooCommerce is the plugin that will help you export and import orders from one site to another.
Using Order/Coupon.Subscription Export Import Plugin for WooCommerce, export all the orders and its metadata into a CSV file. You can read How to Export Orders to a CSV File Using Order/Coupon/Subscription Export Import Plugin for WooCommerce to know help you get started with the plugin easily.
Next, install and activate the Order Import Export plugin in the new site in which the orders have to be imported. Now using Order/Coupon/Subscription plugin for WooCommerce import the CSV with the order details in them.
Since all the products and users are already imported, each order will link to the corresponding user and the products while the orders are being imported.
Note: The order in which the products and the users are imported can be interchangeable since there is no direct relationship between the users and the products. However, it is important that the users and the products be imported before the orders. The orders are associated with the users and the products. This connection is established between the orders and its corresponding data on the new site while the orders are being imported.
If you need the orders be connected to the products and the users, it is mandatory that its related products and users exist on the new website. If the products and users are not present while importing, the orders are not connected with any user or products even the products and users are imported afterward.