How to Migrate a WooCommerce Store Without Losing Orders

Move a WooCommerce shop to a new host: the order-safe sequence, the freeze window, database sync, payment webhooks, cron and email checks, and verification.

Published
Reading time
4 min

A store is a website with a ledger attached. Migrating it is the same as migrating any site, plus one hard problem: orders keep arriving while you copy, and an order placed on the old server after the database snapshot does not exist on the new one. The fix is a short, planned freeze. Here is the whole sequence.

Before the day

  • Lower DNS TTL to 300 at least 24 hours ahead.
  • Pick the window: your quietest hour from the last month's order times (WooCommerce → Analytics → Orders by hour). Tell the team; put a notice in the shop's header the day before if the window is in trading hours.
  • Inventory everything external: payment gateway webhooks (Stripe, PayPal), shipping integrations, marketplace syncs, email service, any plugin with a licence tied to the domain or IP. Each has a place where the site's URL or IP is registered.
  • Prepare the new server: PHP 8.2+, memory_limit 512M, Redis, real cron — the list from WooCommerce hosting requirements.

1. Copy and test (no freeze yet)

Copy the files and take a database dump exactly as in the general guide. Import on the new server, test through a hosts-file entry: browse products, add to cart, place a test order with a real payment in test mode or a 100% coupon. Check the order appears in the new admin, the confirmation email arrives, and the stock decremented. This is the rehearsal; fix everything here.

Delete the test order on the new server afterwards, since the database will be replaced anyway.

2. Freeze the old store

At the start of the window, on the old site:

  • Enable Coming soon / maintenance mode for the storefront (WooCommerce → Settings → Site visibility → Coming soon, or a maintenance plugin), with a short message and a time.
  • Pause the payment gateways (Stripe/PayPal dashboards can pause; or simply the maintenance page prevents checkout).
  • Wait two minutes for in-flight checkouts to finish. Check WooCommerce → Orders for anything pending payment that might still complete.

The freeze lasts as long as the database copy plus the DNS switch: typically 10–20 minutes.

3. Final sync

bash
# files: only what changed since the rehearsal
rsync -avz --exclude='wp-content/cache/' user@old:/var/www/shop/ /var/www/vhosts/shop.example.com/httpdocs/

# database: fresh, consistent dump
mysqldump --single-transaction --quick -u user -p shop_db | gzip > shop-final.sql.gz

Import over the new database (drop and recreate it first so no rehearsal rows remain). Run any search-replace needed for the URL if it changed. Leave maintenance mode on on the new server too until you have checked it.

4. Switch DNS

Update A/AAAA records. With a 300-second TTL, most visitors follow within minutes. Watch with dig +short shop.example.com @1.1.1.1.

5. Re-point the integrations

While DNS settles:

  • Payment webhooks: the gateway calls your site to confirm payments; if the URL or a required IP changed, update it in the Stripe/PayPal dashboard. Most gateways let you send a test event.
  • Cron: disable WP-Cron and set up the 5-minute scheduled task on the new server. Check Scheduled Actions processes.
  • Email: send a test order confirmation; verify SPF/DKIM pass from the new server (setup).
  • Licences: plugins licensed per URL usually carry over; those licensed per IP need re-activation.
  • Object cache: connect Redis and flush it.
  • Caching layers: verify cart/checkout are excluded — add an item, reload, confirm it is still there.

6. Unfreeze and verify

Turn off maintenance mode on the new server, resume gateways, then:

  • Place a real small order end to end. Refund it.
  • Compare the last order number on old and new: they must match.
  • Check the old server's Orders page once more for anything that arrived during the freeze (a payment completing late); if so, recreate it manually on the new site.
  • Watch the new server's error log for 30 minutes.

7. Afterwards

Keep the old server for two weeks with its storefront in maintenance mode — a late webhook or a customer with a cached DNS answer may still reach it, and the maintenance page is what you want them to see. Then export its final orders list, confirm nothing new, and cancel.

What can go wrong

Symptom Cause Fix
Orders stuck pending payment on the new site Webhook still pointed at the old server Update gateway webhook URL
No order emails Cron not running, or mail not authenticated Cron task; SPF/DKIM/PTR
Customer sees an old cart Page cache serving cart pages Add cache exclusions
Stock levels wrong Orders placed during the freeze on the old site Compare order numbers; recreate
Checkout 500 error PHP version or missing extension (intl, soap) Install; check PHP-FPM log

VPSPioneer's free migration runs this sequence for every store we move, including the freeze timing and the webhook re-pointing — the part that costs stores money when it is forgotten.

#migration#woocommerce#wordpress#orders

Keep reading

More from Migration

All guides

Migration

How to Transfer a WordPress Site to a New Host (No Downtime)

Back up WordPress, copy files and database, fix wp-config.php and URLs, test with the hosts file, then switch DNS without losing a visitor or an email.

9 min read →

Migration

How to Migrate from cPanel to DirectAdmin (Step by Step)

Two working routes from cPanel to DirectAdmin: restoring a cPanel full backup on the host side, or moving files, databases and mail by hand, with commands.

6 min read →

Migration

Moving Client Sites Without Downtime: An Agency Checklist

A repeatable checklist for agencies moving client sites to a new host: inventory, rsync and mysqldump, testing before DNS, mail cut-over, SSL and rollback.

6 min read →