Alternatives and Migration

How to Migrate a Website or App to Cloud Hosting Without Losing Data

A step-by-step migration plan for moving a website or application to cloud hosting, covering inventory, backups, testing, DNS cutover, rollback and cost.

Updated · 6 min read

How to Migrate a Website or App to Cloud Hosting Without Losing Data

To migrate to cloud hosting without losing data, take a full backup you have tested, build the new environment in parallel, copy the data, test everything on the new servers before any customer sees it, lower your DNS time-to-live in advance, switch traffic during a quiet window, and keep the old environment running as a fallback for at least a week. Most migration disasters come from skipping the inventory, never testing the restore, or cutting over with no rollback plan. This guide gives you the full sequence with timing and a cost view.

Step 1: Inventory what you actually run

Before choosing anything, write down every component:

  • Websites, applications and their programming languages and versions.
  • Databases, their type, size and any scheduled jobs.
  • Files and uploads, with total size and growth rate.
  • Email sending: many sites rely on the old host's mail server.
  • Scheduled tasks such as cron jobs and backups.
  • Domains, DNS records and SSL or TLS certificates.
  • Third-party integrations that whitelist your server's IP address.
  • Logins, API keys and secrets.

People often discover surprises here, such as a forgotten subdomain or an old script that sends invoices every night. Finding them now beats finding them after cutover.

Step 2: Choose the target and size it

Use the earlier guides to pick a category, then size the new servers from measured usage on the old one: peak CPU, memory, disk and monthly transfer. Start at or slightly above current usage, because resizing is easy afterward. Price the setup with the provider's official calculator, and compare with the migration ROI calculator.

Step 3: Back up and test the backup

A backup you have not restored is a hope, not a backup. Export databases, copy files, and store them in at least one place that is not the old server. Restore the backup to a test location and confirm that the application starts and the data looks right. Record how long the process takes, since this sets your cutover window.

Step 4: Build the new environment in parallel

Set up servers, networking, firewall rules, certificates, monitoring and backups on the new provider. Keep the configuration written down or automated so you can reproduce it. Avoid pointing real traffic at it yet. Use a temporary address or a hosts-file override to access it for testing.

Step 5: Copy data and rehearse

Do a full practice migration. Copy the database and files, run the application, and test critical paths: login, search, checkout, forms, email, reports and admin pages. Check that file permissions, character encodings and time zones are correct. Time the rehearsal.

For large or constantly changing data, plan a two-pass approach: copy the bulk ahead of time, then run a final incremental sync during the cutover window so you only move the recent changes.

Step 6: Prepare DNS

DNS records have a time-to-live (TTL), which is how long resolvers cache them. If the TTL is 24 hours, some users will keep reaching the old server for up to a day after you change the record. A day or two before cutover, lower the TTL to something like 300 seconds (five minutes). After the migration is stable, raise it again.

Step 7: Choose the cutover window

Pick a time with low traffic, such as a weekend night for a business-to-business site, and avoid your busiest season. Tell your team and, if downtime is expected, notify customers. During the window:

  1. Put the old site in maintenance mode or read-only mode if data changes would otherwise be lost.
  2. Run the final data sync.
  3. Run a smoke test on the new environment.
  4. Update the DNS records to the new addresses.
  5. Watch logs and monitoring on both sides.
  6. Confirm that email, payments and scheduled jobs work.

Step 8: Keep a rollback path

Leave the old environment untouched and running for at least a week, and keep it paid for. If a serious issue appears, you can switch DNS back. Remember that data written to the new system after cutover would need to be copied back, so decide in advance the point beyond which rollback is no longer practical.

Step 9: Clean up and verify

After a stable period, remove stale DNS records, turn off the old services, cancel the old plan on the date that makes sense (watch notice periods), and archive a final backup. Review the first invoice on the new platform and compare it to your estimate. Update documentation.

Sample timeline

PhaseTypical duration for a small business siteTypical duration for a custom app
Inventory and planning1 to 3 days1 to 3 weeks
Build target environment1 to 3 days1 to 4 weeks
Rehearsal and testing1 to 2 days1 to 3 weeks
CutoverHoursHours to a weekend
Observation and cleanup1 week2 to 4 weeks

These ranges are rough planning guides, not guarantees. Complex applications take longer.

Migration cost: a worked example

This is an illustrative example. A company pays a contractor 80 dollars an hour for 60 hours: 4,800 dollars. It also pays for one month of overlap on the old host (100 dollars) and a migration tool (200 dollars) for a total of 5,100 dollars. The new hosting saves 250 dollars a month, or 3,000 dollars a year, and the team gains time. Payback is 5,100 / 3,000 = 1.7 years, before counting benefits such as reliability. If the provider offers 1,000 dollars in migration credits, the net cost is 4,100 dollars, and payback falls to about 1.4 years. Only go ahead if the benefits justify it, and be honest about downtime risk.

Common mistakes

  • Skipping the inventory and missing a scheduled job or integration.
  • Forgetting to update the IP address whitelist at a payment processor or API partner.
  • Letting the DNS TTL stay high.
  • Migrating on a Friday afternoon with nobody on call.
  • Not testing email delivery, including SPF and DKIM records.
  • Cancelling the old host the same day as the cutover.
  • Ignoring legal or contractual limits on where data may be stored.

Data protection considerations

If you hold personal information, check where the new provider stores it and whether contracts with customers restrict locations. For health or payment data, confirm that the provider and your configuration meet the relevant standards before moving real records. A migration is also a good moment to delete data you no longer need.

When to consult a professional

Hire an experienced engineer or a migration partner if you have a custom application, a large database, strict uptime needs or regulated data. Ask for a written plan with rollback steps, testing criteria and a fixed scope.

Frequently asked questions

How long does a migration take?

A simple site can move in a weekend. An application with several components may take weeks of planning and testing.

Will my site go down?

It can be near-zero downtime with parallel setup and a DNS switch, but a short read-only period may be needed to keep data consistent.

Do I need to change my domain?

No. You keep the domain and update its DNS records to point to the new host.

Can my old host help?

Many hosts will provide backups or export tools, and some offer free migration services for new customers. Verify what is covered.

Sources

Related guides