While you are working on adding some cool new features to the staging site, a couple of new products, orders, or customers might be added to your live site. Hence, you need to export them from the live site and import them into the staging site right before the pushing process to ensure the staging site has the most recent data you would like to see on the live site after the push.
To do that, you will need to install and activate these two plugins on both the live and staging sites:
1. Product Import Export for WooCommerce By WebToffee: To Export/Import WooCommerce products.
2. Export and Import Users and Customers By WebToffee: To Export/Import WooCommerce Customers.
In this article, we will cover both cases.
Contents
Exporting WooCommerce Products from the Live Site
Under the “WebToffee Import Export (Basic)” menu item, choose “Export,” then select “Product” as the post type to export, as in this screenshot:
In the next step, you are free to choose “Quick Export” then “Export” as in the following screenshot unless you want to adjust any of the advanced settings:
Finally, you will get a pop-up box to download the exported CSV file that includes all your live site’s products:
Importing WooCommerce Products into the Staging Site
It is recommended that you delete all the products on the staging site before importing the exported products file from the live site.
On the staging site, choose “Import” under the “WebToffee Import Export (Basic)” menu item and choose “Product” as the post type to import, as in this screenshot:
It’s enough to select “Quick import,” then upload the CSV file you got from the live site and click the “Import” button as in this screenshot:
Make sure you got this successful message after the import:
Exporting WooCommerce Customers from the Live Site
Similar to exporting products, you can export WooCommerce customers by choosing “User/Customer” as the post type to export, as in this screenshot:
Then it’s okay to select “Quick export” then “Export” unless you want to change any advanced settings:
Importing WooCommerce Customers into the Staging Site
It is recommended that you delete all the customers on the staging site before importing the exported customers file from the live site.
On the staging site, make sure to choose “User/Customer” as the post type to import, as in this screenshot:
Choose “Quick import,” then locate and upload the exported customer CSV file from the live site and click “Import” as in this screenshot unless you want to change some advanced settings:
How to Deal With “Product with the same ID already exists” Error
Just in case you got this error message “Product with the same ID already exists” while importing products on the staging site:
You can open the CSV file using LibreOffice Calc software or Microsoft Excel and delete the values under the “ID” column as in this screenshot, then save the file and re-upload it on the staging site and import it again: