Rollback
Undo a migration by removing all FluentCart records created by the migrator. Rollback uses the ID map to delete records in reverse dependency order.
If a migration produced unexpected results or you need to start over, the rollback feature removes all FluentCart records that were created by the migrator. It uses the ID mapping table to identify exactly which records to delete.
Rollback does NOT restore WooCommerce data
Rollback only deletes FluentCart records created during migration. It does not modify or restore your WooCommerce data in any way. If you need to restore WooCommerce data, use your database backup. That is why backing up before migration is non-negotiable.
When to Rollback
Rollback is appropriate when:
- The migration completed but the data in FluentCart does not look right
- You want to start a fresh migration after fixing issues found in the migration log
- You ran a real migration instead of a dry run by accident
- You migrated the wrong entity types and want to redo it
Rollback is not needed when:
- You ran a dry run — dry runs do not write any data to FluentCart
- You cancelled a migration and want to resume — you can re-run the migration and already-migrated records will be skipped automatically
Running a Rollback
Confirm you have a backup
Before rolling back, make sure you have a database backup. While rollback only deletes FluentCart records (not WooCommerce data), having a safety net is always prudent.
Execute the rollback
Call the rollback endpoint:
curl -X POST "https://yoursite.com/wp-json/cartshift/v1/rollback" \
-H "X-WP-Nonce: YOUR_NONCE"Or use the rollback button in the admin UI at Tools > CartShift.
Review the response
The rollback returns a summary of what was deleted:
{
"status": "rolled_back",
"deleted": {
"subscription": 94,
"order_transaction": 3285,
"order_address": 6340,
"order_item": 5102,
"order": 3241,
"coupon": 27,
"customer_address": 1580,
"customer": 856,
"variation": 298,
"product_detail": 142,
"product": 142,
"category": 12
}
}Each key shows the entity type and the number of records deleted.
Verify in FluentCart
After rollback, check FluentCart to confirm the migrated records have been removed. If FluentCart had existing data before migration, those records are untouched — rollback only removes records that were tracked in the ID map.
Rollback Order
Records are deleted in reverse dependency order to maintain referential integrity:
- Subscriptions — Removed first since they reference orders, products, and customers
- Order transactions — Payment and refund transactions
- Order addresses — Billing and shipping addresses attached to orders
- Order items — Line items from orders
- Orders — The order records themselves
- Coupons — Independent records
- Customer addresses — Addresses attached to customers
- Customers — Customer records
- Variations — Product variations
- Product details — Product detail rows (
fct_product_details) - Products — Product posts (
fluent-productsCPT) - Categories — Product category terms (
product-categoriestaxonomy)
This order ensures that child records are deleted before their parents, avoiding foreign key or orphan record issues.
What Rollback Does
For each entity type, rollback:
- Retrieves all ID mappings from the
cartshift_id_maptable - Deletes the corresponding FluentCart record from the appropriate table
- Removes the ID mapping entries for that entity type
- Resets the migration state (clears the
cartshift_migration_stateoption)
Table deletion targets:
| Entity Type | FluentCart Table |
|---|---|
category | WordPress terms (product-categories taxonomy) |
product | wp_posts (CPT: fluent-products) |
product_detail | fct_product_details |
variation | fct_product_variations |
customer | fct_customers |
customer_address | fct_customer_addresses |
order | fct_orders |
order_item | fct_order_items |
order_address | fct_order_addresses |
order_transaction | fct_order_transactions |
coupon | fct_coupons |
subscription | fct_subscriptions |
What Rollback Does NOT Do
- Does not restore WooCommerce data — Your WC products, orders, customers, etc. are never modified by the migrator. Rollback only touches FluentCart tables.
- Does not preserve the migration log — The log entries remain in the
cartshift_migration_logtable for auditing purposes. Only the ID map entries and migration state are cleared. - Does not delete records that existed before migration — If FluentCart had data before you ran the migration, those records are untouched. Rollback only knows about records tracked in the ID map.
Reviewing the Migration Log After Rollback
Even after rollback, the migration log is preserved. You can review what happened during the previous migration:
curl -X GET "https://yoursite.com/wp-json/cartshift/v1/log?per_page=100" \
-H "X-WP-Nonce: YOUR_NONCE"This is useful for:
- Understanding what went wrong before re-running the migration
- Identifying records that had errors and need attention
- Documenting the migration for audit purposes
Re-running after rollback
After a rollback, the ID map is cleared and the migration state is reset. You can start a new migration immediately. The migrator will treat FluentCart as if no previous migration occurred (because all migrated records have been deleted).
Nuclear Option: Database Restore
If rollback does not fully resolve your situation — or if you need to restore WooCommerce data as well — restore your database backup:
- Deactivate CartShift
- Restore your database backup using your hosting panel, WP-CLI (
wp db import backup.sql), or phpMyAdmin - Reactivate the plugins you need
- Start the migration process from the beginning
This is the most thorough reset but requires you to have made a backup before migration. Which you did, because you read the warning at the top of this page.
Migration Guide
Step-by-step guide to migrating WooCommerce data to FluentCart. Back up, preflight, migrate, verify. Every entity type explained in detail.
Troubleshooting
Common issues during WooCommerce to FluentCart migration and how to resolve them. Preflight failures, stuck migrations, batch errors, and more.