I recently worked with a client who had over 1,200 products, about 200 of which were Variation Products (products with multiple options such as size and color). This database has dozens of product attributes that serve purchasable variations as well as attribute filtering, along with the typical category and tag taxonomies.
I was challenged with how to migrate these products off an unmanaged VPS server and bring them into WordPress.com Business managed hosting* for better security, performance, and lower ongoing maintenance. One of the main goals of this migration was to eliminate legacy plugin cruft and have a newer, cleaner site with fewer and higher quality plugins combined with only the legacy data their operation needed.
First off, I tried the usual WP Admin > Tools > Export/Import utility where you select your export criteria based on the post type, user, month and year, etc. This worked fine for custom post types, blog posts, pages and media, provided I exported into file sizes under 5MB each or split them up after downloading using a file splitter tool. This approach failed for the WooCommerce products and variations as it left orphaned variation records.
Before I could re-attempt that import, I first had to clear out the failed import data from the previous attempt. To do this, I first utilized the Delete orphaned variations button located in WP Admin > WooCommerce > Status > Tools. Next, I installed the free plugin Woo Product Remover to clear out the previously imported products.
Next, I was able to successfully import all products, taxonomies and variations. For this I used the built-in Product CSV Importer and Exporter* wizard available since WooCommerce v3.1.0. This tool can be found adjacent to the Add Product button on the WP Admin > WooCommerce > Products page. It took close to an hour to run and I was able to watch the products roll in by refreshing the Products page in another browser tab.
Thought I’d share this if it helps anybody else trying to migrate large stores from one site to another. Also, while it’s a lot more work to migrate specific data from one site to another as opposed to copying the entire WordPress Database as-is, this is one useful technique to clean-up legacy data than can clog-up your site performance.