---
title: Migrating WooCommerce Orders And Customers Between Sites
url: "https://pressable.com/knowledgebase/migrating-woocommerce-orders-and-customers-between-sites/"
published: 2025-12-10
modified: 2025-12-11
author: Nox Dineen-Porter
---

This guide covers how to migrate only WooCommerce order and customer data from one site to another. This process can be helpful when a staging site is out of sync with production, or when you need to perform an e-commerce migration without putting the origin site into maintenance mode to stop new orders during the migration window.

 
 Warning **Before starting any migration back up both source and destination databases** using [Pressable’s backup tools](https://pressable.com/knowledgebase/how-to-manually-back-up-your-site/) or [phpMyAdmin](https://pressable.com/knowledgebase/access-phpmyadmin-with-wordpress/) export.

These steps are intended for technical users. Partial database migrations are outside Pressable’s [scope of support](https://pressable.com/legal/support-policy/), although the support team is happy to answer questions and provide general guidance. We provide this information so you can choose the method that best fits your workflow and resources.

## **Understanding WooCommerce Order And Customer Data**

WooCommerce stores order and customer information across several core tables. The most relevant include the following.

### **When HPOS Is Off (Legacy Storage)**

Core order and customer tables to export/import:

- `wp_posts` (orders are stored as `post_type = 'shop_order'`)
- `wp_postmeta`
- `wp_woocommerce_order_items` (legacy item storage)
- `wp_woocommerce_order_itemmeta`
- `wp_users` (customers)
- `wp_usermeta`
- `wp_woocommerce_payment_tokens` and `wp_woocommerce_payment_tokenmeta` (if used)
- Any plugin custom tables that store order/customer metadata (varies based on installed plugins)

**Note:**

- `wp_posts` + `wp_postmeta` must be migrated together; otherwise order records will be broken.

### **When HPOS Is On (HPOS / Custom Order Tables)**

Core HPOS order tables to export/import:

- `wp_wc_orders` (main orders table)
- `wp_wc_order_addresses` (billing/shipping addresses)
- `wp_wc_order_operational_data` (internal operational state)
- `wp_wc_orders_meta` (order meta stored in HPOS)

Important lookup / index / reporting tables you should also consider (HPOS or mixed environments):

- `wp_wc_order_stats` (order stats index used for reports)
- `wp_wc_order_product_lookup` (order->product lookup)
- `wp_wc_order_tax_lookup`
- `wp_wc_order_coupon_lookup`
- `wp_wc_customer_lookup` (customer lookup table; used heavily for reports and queries)
- `wp_wc_product_meta_lookup` (product lookup; relevant if migrating product-related lookups)

**Note:**

- Some of these lookup tables are populated by background processes and sync jobs. Copying them can be useful for reporting continuity, but you may also be able to regenerate them after import using the “Regenerate Product Lookup Tables” tool mentioned in the After Migration Steps section.

### **If A Site Has HPOS Enabled But You Are Merging Into A Non-HPOS Site (Or Vice Versa)**

You cannot simply copy HPOS tables into a site that is not also using HPOS without first running the WooCommerce migration/sync to convert the destination site to HPOS; doing so will create mismatches.

WooCommerce’s guide to enabling HPOS can be found [here](https://developer.woocommerce.com/docs/features/high-performance-order-storage/guide-large-store/).

If you’re comfortable using command line options, you may opt to use the WooCommerce HPOS migration/sync tooling instead. Common WP-CLI commands to help manage HPOS migration and sync include:

- `wp wc hpos status` (check current HPOS status)
- `wp wc hpos sync` (sync between storage types)
- `wp wc hpos migrate` (migrate orders between storage types)

Check [WooCommerce’s official documentation](https://developer.woocommerce.com/docs/features/high-performance-order-storage/cli-tools/) for current command syntax and options, as these may change with WooCommerce updates.

**Your installation may have additional tables created by extensions or payment gateways.** Confirm which tables your plugins use before migrating.

## **Option 1: Migration Plugins That Support Table Selection**

Several plugins allow selective migration of specific database tables. This is the easiest method when supported.

Common options include:

- [WP Migrate DB Pro](https://deliciousbrains.com/wp-migrate-db-pro/)
- [Migrate Guru](https://wordpress.org/plugins/migrate-guru/)
- [All In One WP Migration Pro ](https://servmask.com/products)

General workflow:

1. Install the migration tool on both the source and destination sites.
2. Select only the WooCommerce related tables or a custom set of tables.
3. Run the migration and confirm that no other site data is overwritten.

**Notes:**

- Large datasets may require multiple migration passes due to upload limits and PHP timeouts.
- Always create a backup before running a plugin based migration.

## **Option 2: Manual Export And Import Using phpMyAdmin**

phpMyAdmin allows you to export and import specific tables directly.

To export:

1. [Open phpMyAdmin from the Pressable control panel](https://pressable.com/knowledgebase/access-phpmyadmin-with-wordpress/).
2. Select the source database.
3. Choose only the required tables.
4. Export using the SQL format.

To import:

1. Select the destination database.
2. Use the Import tab to upload the SQL file.
3. Confirm that the data has appeared in the correct tables.

**Important considerations:**

- Importing may overwrite existing rows for the selected tables if order numbers or ID values are duplicated.
- **Ensure related tables are exported together.** For example, `wp_woocommerce_order_items` and its associated `wp_woocommerce_order_itemmeta` table must be migrated as a pair or order item data will be incomplete. The same applies to `wp_posts` and `wp_postmeta`, `wp_users` and `wp_usermeta`, and similar parent/child table relationships.
- Back up both databases before beginning.

## **Option 3: Manual Export And Import Using WP-CLI**

WP-CLI allows you to export specific tables at the command line. This is useful for larger datasets or automation.

Examples:

Export a single table:

```
`wp db export orders.sql --tables=wp_po`sts
```

Export multiple tables:

```
`wp db export woo.sql --tables=wp_posts,wp_postmeta,wp_woocommerce_order_items,wp_woocommerce_order_itemmeta`
```

Import into the destination site:

```
`wp db import woo.sql`
```

 Info:Pressable’s server configuration requires specific parameter ordering for WP-CLI commands. If a command fails, try adjusting the order of flags and parameters (for example, placing table names before the export filename). If you continue to experience issues, consult the [WP-CLI reference](https://developer.wordpress.org/cli/commands/) for alternate parameter structures.

## **Option 4: Export And Import Using Bash Tools**

Pressable provides SSH/SFTP access to your site. You can [connect to SSH on Pressable](https://pressable.com/knowledgebase/connect-to-ssh-on-pressable/) to use raw database tools like `mysqldump` for table specific exports. This method provides the most control and is often preferred for very large WooCommerce datasets.

You can find your site’s database name in the upper left corner of phpMyAdmin.

![Screenshot of phpMyAdmin with an arrow pointing to the database name in the upper left corner (in the sidebar).](https://i0.wp.com/pressable.com/wp-content/uploads/2025/12/Woo-partial-migration.jpg?resize=1024%2C471&ssl=1)
 
 Example export:

```
mysqldump [DATABASE NAME] wp_posts wp_postmeta wp_woocommerce_order_items wp_woocommerce_order_itemmeta > woo.sql

```

Example import:

```
mysql [DATABASE NAME] < woo.sql
```

## **Option 5: API Based Migration**

Developers may use [WooCommerce REST API](https://woocommerce.com/document/woocommerce-rest-api/) endpoints to pull and push order or customer data. This is the most flexible option for complex migrations or when you need fine-grained control over what gets migrated, but it requires scripting knowledge and development time.

## **After Migration Steps**

Once data has been transferred:

1. **Verify migration success** by checking several recent orders to confirm all data (customer info, order items, metadata) transferred correctly.
2. Open WooCommerce, then Status, then Tools, and run: 
    - Regenerate Product Lookup Tables
    - Recount Terms
    - Clear WooCommerce Transients
3. Clear the Pressable object cache with:

```
wp cache flush
```

4. Confirm that any payment gateways or shipping plugins still recognize customer records.
5. Review webhook settings or API credentials for staging sites moved to production.

## **Common Pitfalls To Avoid**

- Forgetting to copy `wp_postmeta` and `wp_usermeta` along with their parent tables.
- Missing custom tables created by payment gateways or fulfillment plugins.
- **Importing into a site where orders with matching IDs already exist can cause overwrites or conflicts.** Consider whether you need to merge data or fully replace it before proceeding.
- Keeping old staging URLs in order notes or metadata that trigger unexpected behavior.

## **Summary**

There are several ways to migrate WooCommerce order and customer data depending on your level of comfort and the complexity of your store. Plugin based migrations are simplest, database exports are the most accurate, and CLI tools offer the greatest flexibility.

**Always back up your sites before making changes and verify data integrity after import.**
