Same price at renewalFree .com domain with yearly plans7-day money-back guarantee24/7 tickets · Live help Mon–Sat 9–6JazzCash & Easypaisa acceptedSame price at renewalFree .com domain with yearly plans7-day money-back guarantee24/7 tickets · Live help Mon–Sat 9–6JazzCash & Easypaisa accepted

How to Move Your Website to a New Host

By Muhammad Ashir Rana, Founder, XHOST · Updated

Moving a website to a new host sounds risky, but with the right order of steps visitors never see downtime and no email is lost. This guide walks through moving a WordPress or cPanel website from any host to another in Pakistan, including .pk domains, email and the DNS switch.

Before you start

  • Don't cancel the old hosting yet. It keeps serving the site while you move.
  • Find your logins: old host cPanel or WordPress admin, domain registrar (or PKNIC for .pk), and email passwords.
  • Pick a quiet time for the DNS switch, such as late evening.
  • List your email addresses so you can recreate every one.

Step 1: Back up everything on the old host

  • cPanel hosts: use Backup or Backup Wizard to download a full backup (files, databases, email).
  • WordPress only: a migration plugin can package files and database into one file.
  • Email: mail stays on the old server until you copy it; note each mailbox and its size.

Step 2: Restore on the new host and test

  1. Upload the files to the new hosting account and import the database.
  2. Update the database name, user and password in the site's configuration (wp-config.php for WordPress).
  3. Create the same email addresses on the new server.
  4. Preview the site on the new server before changing DNS (your host can show you how, for example with a temporary URL or by editing your computer's hosts file).
  5. Check the home page, forms, logins and checkout.

Step 3: Switch DNS without downtime

A day before the switch, lower the TTL on your DNS records to 300 seconds if your DNS provider allows it, so the change spreads faster. Then either:

  • Change nameservers to the new host's nameservers at your registrar. This moves website and email DNS together.
  • Or change only the A record (website) and MX records (email) if you manage DNS elsewhere, such as Cloudflare.

.pk and .com.pk domains: nameservers are changed through your registrar or PKNIC reseller. If you don't have access, ask the company that registered the domain to update them; the domain stays registered in your name.

Step 4: After the switch

  1. Allow up to 24–48 hours for everyone's internet provider to see the new DNS.
  2. Copy any email that arrived at the old server during the switch, over IMAP.
  3. Turn on SSL on the new host and make sure the site opens on https://.
  4. Resubmit your sitemap in Google Search Console.
  5. Only then cancel the old hosting.

Common problems and fixes

  • "Error establishing a database connection": the database details in wp-config.php don't match the new database.
  • Site redirects to the old address: update the site URL in WordPress settings or the database.
  • Email works for some people only: DNS is still spreading; wait, and check MX records point to the new server.
  • Images missing: the uploads folder wasn't copied completely.

Let XHOST move it for you

On yearly plans we move your website, database and email for free. Order a plan, then open a ticket or email support@xhost.pk with your current host's details, and our Lahore team does the steps above for you. Compare plans and prices.

Frequently asked questions

Will my website go down when I change hosting?

Not if you keep the old hosting active, set up and test the site on the new host first, and only then change nameservers or DNS records.

How long does it take to move a website to a new host?

Copying a typical site takes under an hour. The DNS change can take up to 24–48 hours to reach everyone, during which both servers can answer.

Do I lose my emails when moving hosting?

No, if you create the same mailboxes on the new server and copy old mail over IMAP before cancelling the old host.

Does XHOST migrate websites for free?

Yes, on yearly plans. After ordering, open a ticket or email support@xhost.pk with your current host details and our team moves the website, database and email.