How to Migrate a Website from One Hosting to Another (Complete Step-by-Step Guide)

How to Migrate a Website from One Hosting to Another (Complete Step-by-Step Guide)

Moving a website to a new host is a set of small steps in the right order: back up, set up the new account, copy files and the database, test, switch DNS, then check everything. Done in that order, visitors rarely notice. This guide covers a general migration for any site, with a WordPress section and a plan for keeping downtime close to zero.

Why people move hosts

The usual reasons are slow pages, outages, renewal prices that jumped, weak support or a site that outgrew its plan. If speed is the reason, check Google’s Core Web Vitals first, since page experience is part of how Google evaluates pages. If price is the reason, compare the renewal price, not the intro price. Our web hosting plans start at $2.89/month, and there is an upgrade path to VPS hosting when you need it. Whatever your reason, the steps below apply to most hosts and platforms.

What to have ready

  • Login to your current control panel (cPanel, Plesk or a custom dashboard).
  • FTP or SFTP details for the old and new server.
  • Database name, user, password and host. For WordPress they are in wp-config.php.
  • Login to your domain registrar, so you can change DNS. If the domain is with VeerHost, see domain names.
  • The new account’s server IP, nameservers and cPanel login.
  • A staging or temporary URL on the new host, if it offers one.

Step 1: Back up everything

Do not start without a full backup. A site has two parts: the files (HTML, PHP, CSS, JavaScript, images and uploads, usually in public_html) and the database (MySQL or MariaDB) behind WordPress, Joomla, Drupal, shops and any site with accounts or forms.

For files, use the Backup or Backup Wizard section in cPanel to download a home directory backup. You can also connect with an FTP client such as FileZilla and copy the folder to your computer. For the database, open phpMyAdmin in cPanel, select the database, click Export, choose the Quick method and SQL format, and save the file. On WordPress, plugins like All-in-One WP Migration or UpdraftPlus can back up both in one go.

Keep the backup in two places, for example your computer and a cloud drive.

Step 2: Choose the new host

Compare hosts on things you can check: storage type (NVMe or SSD), web server and PHP versions, the uptime guarantee and how it is measured, how support works, whether you can upgrade without moving again, security basics, the renewal price and the data centre location. A location closer to your visitors lowers latency. You can check VeerHost’s live status on our system status page, and see how we handle refunds and billing before you buy. To turn on HTTPS, see how to enable free SSL in cPanel. If you are weighing options, our best web hosting in the USA guide compares ten providers.

Step 3: Set up the new account

In the new cPanel, open MySQL Databases and create a database and a user with a strong password, then give that user all privileges on the database. Write down the credentials. Also note the server IP, FTP host, username and password, and the nameservers.

If you use email on your domain, create the mailboxes now so no mail is lost when DNS changes. Our guide on creating an email address in cPanel explains how. If you would rather not do the move yourself, VeerHost includes free migration, so contact support to arrange it.

Step 4: Copy the files

There are three ways to do it.

FTP

Connect to the new server with FileZilla, open public_html and upload your backup. It is reliable but slow for sites of several gigabytes.

cPanel File Manager

Zip the site, upload the single archive with the Upload button in File Manager, then extract it in place. This is much faster than FTP for large sites because you transfer one file.

SSH and rsync

With SSH on both servers, rsync copies only what changed and is the fastest option for big sites:

rsync -avz --progress [email protected]:/public_html/ [email protected]:/public_html/

SSH is included on VeerHost VPS plans. See getting started with your VeerHost VPS.

Step 5: Move the database

Open phpMyAdmin on the new host, select the new database, choose Import, pick your .sql file and click Go. For databases over roughly 50 MB, phpMyAdmin may time out. Use the BigDump script or split the SQL file into smaller parts.

Then point the site at the new database. In WordPress, edit these four values in wp-config.php:

define('DB_NAME', 'your_new_database_name');
define('DB_USER', 'your_new_database_user');
define('DB_PASSWORD', 'your_new_database_password');
define('DB_HOST', 'localhost');

On most shared hosting DB_HOST stays localhost. Joomla uses configuration.php and Drupal uses settings.php for the same job.

Step 6: Point your domain to the new host

DNS connects your domain to the server’s IP address. You have two options.

Change the nameservers

Log in to the registrar and replace the nameservers with the new host’s. It is the simplest route. For VeerHost, see how to point your domain to VeerHost.

Change only the A record

Keep DNS where it is, for example to keep existing email records, and change the A record to the new server’s IP. See pointing your domain using A records.

DNS propagation

DNS changes spread gradually, from a few minutes to about 72 hours, depending on the TTL and on how long resolvers cache. To shorten it, lower the TTL to 300 seconds at least 24 hours before the move. During propagation some visitors still see the old site, which is normal. Our guide on DNS propagation explains why. You can check records with our DNS lookup tool, and confirm the certificate with the SSL checker.

Step 7: Test before you switch

Test the new copy without changing public DNS. Edit your computer’s hosts file so your own device resolves the domain to the new server’s IP. On Windows it is C:\Windows\System32\drivers\etc\hosts, on macOS and Linux it is /etc/hosts. Add a line like this, using the new server’s IP:

203.0.113.10   yourdomain.com

Many hosts also give a temporary URL you can use instead. Check that pages and images load, menus and forms work, logins work, checkout and payments work on a shop, and media and downloads open. Compare speed with the website speed test or PageSpeed Insights. Remove the hosts line when you are done.

Step 8: Go live

Update the nameservers or A record. Keep the old hosting account for at least 48 to 72 hours, because some resolvers will still send visitors to it. Avoid content changes on the old server in that window, since new posts, orders or form entries there will not reach the new one. If the site gets frequent updates or orders, schedule the switch for a quiet hour. To check it worked, read how to verify your domain is pointing to VeerHost. Watch the new server’s error logs for 404s, PHP errors and database connection errors during the first one to two days.

Step 9: After the move

  • Confirm HTTPS works on every page and the certificate is valid.
  • Check Google Search Console for new crawl errors, and resubmit your sitemap. If it says “Couldn’t fetch”, see how to fix the sitemap fetch error.
  • Watch your rankings for a few days. Small movement is normal. A big drop points to broken pages or slow loading.
  • Re-run the speed test and compare with your numbers from the old host.
  • Send test messages from each form and send and receive email. If delivery fails, start with fixing email delivery (SPF, DKIM and DMARC). For mail clients, see setting up email in Outlook and Apple Mail.
  • Update the site URL in analytics, ad platforms and social profiles if it changed.
  • Cancel the old plan once everything is stable. Check its billing terms first.

Moving a WordPress site

WordPress powers more than 40% of websites, so it is worth a section of its own. We also have a detailed guide for migrating a WordPress site to VeerHost, files and database.

The easiest route is a plugin. All-in-One WP Migration exports your whole site to one file that you import on the new host, and its free version works for sites under 512 MB. Duplicator builds an archive plus an installer script and handles the database import and URL replacement. UpdraftPlus is mainly a backup plugin but can restore onto a new server.

To migrate by hand:

  1. Export the database with phpMyAdmin.
  2. Download all WordPress files, including wp-content, wp-admin, wp-includes and the root files.
  3. Create a new database and user on the new host.
  4. Upload the files.
  5. Import the SQL file.
  6. Update wp-config.php with the new database details.
  7. If the domain or folder changed, update the siteurl and home values, and use a search-and-replace tool such as Better Search Replace for hard-coded URLs.

Afterwards, save the permalinks under Settings, then Permalinks, clear any caching plugin, and check that .htaccess exists. Our guide on installing WordPress on VeerHost covers the cPanel side, and WordPress hosting is our plan built around it.

Migrating with no downtime

The idea is to have the new site fully working before you change DNS, and to keep the old one running. Lower the TTL to 300 seconds a day ahead. At cutover, make your final changes on the old server, take a last backup, copy the recent changes to the new server, switch DNS and watch both servers for an hour or two.

For shops, membership sites and forums, even a few minutes of split traffic can cause data to go missing. A short maintenance window, ideally under 15 minutes, is safer than chasing zero downtime. Put a maintenance page on the old server, run the final sync, then switch DNS.

If you use Cloudflare, you can change the origin IP in Cloudflare instead of changing DNS, and visitors see the change almost immediately.

Common mistakes

  • Starting without a backup.
  • Forgetting to update wp-config.php or its equivalent, which causes a database connection error.
  • Missing the hidden .htaccess file. Turn on hidden files in your FTP client.
  • Switching DNS before testing on the new server.
  • Changing nameservers before mailboxes exist on the new host, so mail bounces. See webmail with Roundcube for checking it after.
  • Cancelling the old plan too early, or forgetting to cancel it at all.
  • Not watching the site for the first 48 to 72 hours.

FAQ

How long does a migration take?

A small blog can move in one to two hours. A large shop with thousands of products and a big database can take a day or more. DNS propagation adds up to 48 hours or so regardless of size.

Will migrating hurt my SEO?

Not if URLs stay the same, redirects are correct and nothing breaks. A faster, more stable host can help over time. The risk comes from missing pages, broken links or slow loading after the move.

Do I need to tell Google?

No. If the domain and URLs stay the same, Google finds the new server on its own. Resubmitting the sitemap and watching Search Console for crawl errors is good practice.

Can I migrate without technical knowledge?

Copying files and changing DNS is manageable with a guide. Database work and troubleshooting are harder. Use the knowledge base or ask support about a managed migration.

Nameservers or A record?

Changing nameservers hands all DNS to the new host. Changing only the A record keeps DNS where it is and changes just the server IP. Both point the domain at the new server.

Is migration free?

VeerHost includes free migration. Contact support and we will move your site, or follow our guides to do it yourself.

What happens to my email?

If email is hosted with your website, set up the mailboxes on the new host before you change nameservers, and keep the old mailbox until you are sure everything arrived.

Can I migrate any type of site?

Yes. The core steps are the same for WordPress, Joomla, Drupal, Magento, OpenCart, PrestaShop and custom sites. For VPS moves, see hosting a website on your VPS.

How do I transfer a domain to VeerHost?

Follow our guide on transferring a domain to VeerHost. Keeping domain and hosting together simplifies DNS and renewals.

Ayman Al-Junaid is the founder of VeerHost and a web developer. He leads the development of VeerHost. On this blog he shares practical guides on web hosting, WordPress, VPS servers and website performance for site owners, developers and small businesses.

Launchpad