Website Migration: How to Move to a New Host Without Downtime

A step-by-step website migration guide: back up files and databases, copy them over SFTP, test before switching DNS, and move to a new host without downtime.

SafaHost team · · 7 min read

Website Migration: How to Move to a New Host Without Downtime

Website migration sounds risky, but moving a site to a new host is a routine job when you follow the right order: copy everything, test it on the new server, and only then point your domain at it. Done this way, visitors keep seeing a working website the whole time, and your old hosting stays as a safety net until you are sure the move succeeded.

This guide walks through a complete website migration for a typical small business site, from the first backup to cancelling the old plan, with a checklist you can follow step by step.

When a website migration makes sense

Most businesses move hosts for one of a few practical reasons:

  • Speed. Pages load slowly even after you have compressed images and cleaned up plugins.
  • Location and data residency. You want your site and its data hosted in Oman, closer to your visitors.
  • Outdated software. The current host still runs an old PHP version or slow storage.
  • Support. Problems take too long to solve, or help is not available in your language.
  • Cost and control. You want clearer pricing in OMR or more control over the server.

If two or more of these apply, a move is usually worth a weekend of careful work.

Before you start: take stock of what you are moving

A smooth migration starts with an inventory. Write down every part of your current setup:

  • Website files. Themes, plugins, uploads, custom code and any .htaccess rules.
  • Databases. Most WordPress, Joomla and OpenCart sites use one MySQL database. Note its name and user.
  • PHP version and settings. Check which version the site runs on today and test it on the newer version you will use.
  • Domain and DNS. Where the domain is registered, which nameservers it uses, and every DNS record, especially MX records for email.
  • Scheduled tasks and integrations. Cron jobs, payment gateways, form services and API keys.

Pay special attention to email. If your email is hosted separately, its MX records must stay exactly as they are when you change DNS. Copy the full DNS zone before you touch anything; our guide to DNS records explained shows what each record does.

Step 1: Make a full backup of files and database

Never start a website migration without two complete copies of your site: one you will move, and one you keep untouched.

  1. Download all files over SFTP, or use your host's file manager to create an archive.
  2. Export the database as a .sql file using your host's database tool or a command-line export.
  3. Store both copies on your computer and in a second location, such as cloud storage.

For WordPress, a reputable migration or backup plugin can package files and database together. Even then, keep a manual copy. Plugins are convenient, but a plain file and database export is the copy you can always restore.

Step 2: Set up the new hosting account

Choose a plan that matches the site. A brochure site or blog fits well on standard Linux hosting or WordPress hosting. If your customers are mainly in Oman, or you prefer your data to stay in the country, Oman Web Hosting runs on servers in Muscat.

Once the account is active:

  • Create an empty MySQL database and a database user with a strong password.
  • Set the PHP version to match what the site needs, ideally a current one such as PHP 8.3.
  • Note the SFTP details you will use to upload files.

Do not change your domain's DNS yet. At this point, the new server is a private copy that only you will use.

Step 3: Copy files and import the database

Upload your files over SFTP into the correct web folder on the new server, then import the .sql file into the new database.

Next, update the site's configuration so it connects to the new database:

Platform Configuration file Settings to update
WordPress wp-config.php DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
Joomla configuration.php $db, $user, $password, $host
PrestaShop app/config/parameters.php database_name, database_user, database_password
OpenCart config.php and admin/config.php DB_DATABASE, DB_USERNAME, DB_PASSWORD, paths
Drupal sites/default/settings.php database, username, password, host

If the domain name stays the same, you normally don't need to change URLs inside the database. If you are also changing the domain, use a search-and-replace tool that handles serialised data correctly; a plain text replace can break WordPress settings.

Step 4: Test the site before switching DNS

This is the step that prevents downtime. You can view the site on the new server before the world sees it by editing the hosts file on your own computer, so that your domain points to the new server's IP address only for you.

Check everything a customer would use:

  • Home page, key service pages and the blog
  • Contact forms and any booking or quote forms
  • Logins to the admin area
  • Shop pages, cart and a test checkout if you sell online
  • Images, downloads and any embedded maps or videos
  • Arabic and English pages, if the site is bilingual

Fix any errors now, while the old site is still live. Remove the hosts file entry when you are done testing.

Step 5: Switch DNS with minimal downtime

DNS changes are not instant. Resolvers cache records for the length of their TTL (time to live), so lowering the TTL in advance makes the switch faster.

  1. One or two days before the move, lower the TTL of your A and www records to around 300 seconds.
  2. Freeze content changes on the old site, such as new orders, posts or comments, shortly before the switch, then copy across anything that changed since your backup.
  3. Update the records to point to the new server's IP address, or change nameservers if the new host manages your DNS.
  4. Keep MX records unchanged so email keeps arriving where it does today.

Most visitors will reach the new server within minutes to a few hours. Because both servers show the same site during that window, visitors don't notice the change.

Step 6: After the move

Once traffic is on the new server, finish the job properly:

  • Confirm SSL. Make sure the certificate is active and the site loads over HTTPS. Our free SSL certificate guide explains what to check.
  • Watch for errors for a few days: forms, emails sent by the site, scheduled tasks and payment notifications.
  • Check Google Search Console for crawl errors and resubmit your sitemap.
  • Raise the TTL back to a normal value once everything is stable.
  • Keep the old hosting for a week or two as a fallback, then download a final copy and cancel it.

Moving to SafaHost

Starter web hosting and WP Starter are activated automatically within minutes after payment, with SFTP, MySQL, PHP 8.3, NVMe storage and free auto-renewing SSL, so the new server is ready as soon as you are. Oman Web Hosting on servers in Muscat is set up by our team within one working day. If you get stuck at any step, our support team answers 24/7 by ticket and email, in Arabic and English, through the help centre.

Frequently asked questions

How long does a website migration take?

For a typical small business or WordPress site, the hands-on work takes a few hours: backing up, uploading, importing the database and testing. DNS changes then reach most visitors within minutes to a few hours, especially if you lowered the TTL beforehand.

Will my website go down during the move?

Not if you follow the order in this guide. The old site stays online while you build and test the copy on the new server, and both serve the same content while DNS updates.

Will moving hosts hurt my SEO?

A migration that keeps the same domain and URLs, loads at least as fast and stays on HTTPS usually has no lasting effect on rankings. Problems come from broken links, missing pages or long outages, which careful testing avoids.

Do I need to move my domain too?

No. You can keep the domain with its current registrar and only change its DNS records or nameservers. Transferring the domain is a separate task you can do later if you want everything in one place.

What happens to my email when I change web host?

If your email is hosted somewhere else, it keeps working as long as you leave the MX and related DNS records unchanged. Copy your DNS zone before the move and compare it afterwards.

Planning a move? Start with the right plan: WordPress hosting for WordPress sites, or Oman Web Hosting to keep your website and its data in Muscat.

Keep reading