Migrating a live e-commerce store carries higher stakes than a typical website migration — orders and inventory changes can't simply pause during the process. This guide covers a careful, low-downtime migration approach.
Why E-commerce Migration Needs Extra Care
Orders can be placed at any moment, including during your migration window — a naive "copy everything, then switch DNS" approach risks losing orders placed during the gap between your final backup and the actual cutover.
Step 1 — Set Up the New Server Fully First
Provision and fully configure the new VPS — web server, database, PHP, and the e-commerce platform itself — before touching the live store at all. See How to Order and Deploy Your First VPS with VPS For Life for initial provisioning.
Step 2 — Do an Initial Full Sync (While the Old Site Stays Live)
rsync -avz -e ssh user@old-server:/var/www/store/ /var/www/store/
mysqldump -u user -p store_db | ssh user@new-server "mysql -u user -p store_db"
This initial sync can take time for larger stores, but the old site remains fully live and operational throughout.
Step 3 — Test Thoroughly on the New Server
Using the new server's IP address directly (or a temporary hosts file entry mapping your domain to the new IP locally), thoroughly test checkout, payment processing, and admin functionality before considering cutover.
Step 4 — Schedule a Brief Maintenance Window
Even with careful preparation, a short maintenance window (minutes, not hours) minimizes risk during the final, critical steps:
- Put the OLD site into maintenance mode, blocking new orders temporarily
- Perform one final, quick database sync to capture any last-minute changes
- Switch DNS to point to the new server (see How to Point a Domain to Your VPS)
- Verify the new site is fully functional
- Take the old site out of maintenance mode only once fully confident, or decommission it
Step 5 — Lower DNS TTL in Advance
Reduce your domain's DNS TTL to a low value (e.g. 300 seconds) a day or two before migration, so the actual cutover propagates quickly once you make the change.
Step 6 — Monitor Closely After Cutover
Watch order processing, payment gateway callbacks, and error logs closely in the hours immediately following cutover — catch any issues before they affect many customers.
Step 7 — Keep the Old Server as a Fallback Temporarily
Don't decommission the old server immediately — keep it available (though not actively serving traffic) for a period in case an unexpected issue requires reverting.
Handling Payment Gateway Webhook URLs
If your payment gateway sends webhooks to a specific URL, verify this continues working correctly after migration — typically fine if the domain itself doesn't change, but worth explicitly testing.
Common Errors
Orders placed during the maintenance window are lost — properly displaying a maintenance page that prevents new orders (rather than allowing checkout against a database that's about to be replaced) avoids this entirely.
Continue Reading
- How to Set Up Automated Backups for an E-commerce Store
- How to Point a Domain to Your VPS (A/AAAA Records)
- How to Set Up a Staging Environment for an E-commerce Store
Browse more articles in E-commerce Platform Deployment.