How to Change Website Host [Step by Step]

How to Change Website Host

Let’s face it, moving your website from one hosting company to another can be a daunting and stressful task.

But it doesn’t have to be!

With a little bit of planning and these simple steps, you can make the switch with ease.

We have been in the online marketing business since 2009, and in that time we’ve built hundreds of websites on a variety of hosting providers.

We’ve also switched our own websites over to new hosting providers dozens of times.

So, I can say with confidence that it’s not as difficult as it may seem.

Here’s our simple guide on how to change website hosts, step by step:

Step 1: Choose a New Hosting Provider

The first step is choosing a new web hosting provider worth your money.

Web hosting

I can’t tell you how many people I know that change hosting provides every few months.

This is ridiculous and not only a waste of time but it’s also a waste of money.

I understand that it’s really hard to know which hosting provider is the best because you simply don’t have the resources to test them all out and see for yourself.

Luckily, we do.

We have tested and reviewed hundreds of hosting providers and have compiled a list of the best ones.

Here are a few of our favorites

Step 2: Choose Between Using a Migration Service or Do It Manually

Migrating your website to a new host can be quite technical.

You have to transfer your files, change DNS settings, update databases, and more.

Tools For Web Hosting Transfer

This can be overwhelming and even a little scary if you are not a technical person.

That’s why many web hosts offer free site migration for new customers.

Using a Migration Service

The process will be much easier if you decide to use a migration service.

You won’t have to worry about any of the technical details because your new provider will take care of it for you.

Wordpress Manager

All you need to do is:

  1. Sign up with a hosting provider that offers free migration, such as SiteGround, Cloudways, InMotion Hosting, or GreenGeeks.
  2. Request a site migration and provide your previous hosting provider details to the support team.
  3. Sit back and relax while the migration team does all the work for you.

If you have a WordPress site, then you are in luck.

Some hosting companies, such as Cloudways and SiteGround have their own WordPress migration plugins that can automatically migrate your website to the new hosting account in a matter of minutes and for free.

You just need to download the plugin, install it on your WordPress site, and follow the instructions.

Pros
  • The process is very simple and straightforward
  • You don’t have to worry about any of the technical details
  • It’s usually free of charge
Cons
  • It can take a few days for the migration to be completed
  • You’re relying on someone else to do it for you, so you don’t have full control
  • Not all web hosts offer this service for free

Migrating Your Website Manually

Although the process of migrating your website manually may seem daunting, it’s actually not that difficult.

Website Transfer

Read on and you’ll find out each step you need to take to do it yourself without any problems.

Pros
  • It’s a very useful skill to have if you intend to manage your own website
  • You learn a lot of technical details about how your website, which will help you troubleshoot any problems in the future
  • It’s usually faster than using a migration service since you’re in control of the process
Cons
  • It’s a more technical process, which can be overwhelming for some people
  • You have to be very careful so that you don’t break anything
  • If you make a mistake, it could cause your website to go offline

Step 3: Backup Everything!

I won’t be exaggerating if I say this is the most important step in the whole process.

Back up

During the migration, there is always a small chance that something could go wrong.

It’s very rare, but it does happen.

That’s why it’s crucial that you have a recent backup of your website before you start.

Most hosting providers offer some kind of backup service, but it’s always a good idea to have your own backup as well.

Hostgator Backups

That way, you’re sure that you won’t lose any data if something does go wrong.

There are two things you need to backup:

  • Your site files: These are the files that make up your websites, such as your HTML, CSS, and image files.
  • Your database: This is where all your website’s content is stored, such as your posts, pages, and comments.

Method 1: Backup Your Website Using cPanel

  1. Log in to your cPanel
  2. Search for Backup
  3. Scroll down to Full Backup, and click Download a Full Website Backup
  4. Under Backup Destination, select Home Directory
  5. Click Generate Backup
  6. Wait till the backup is generated, then scroll up to the Backups Available for Download section and click on the most recent backup file to download it.
  7. Go to the Databases section and click on phpMyAdmin
  8. Select your site’s database, then click Export
  9. On the next page, click Go to start the download
  10. That’s it! Now you have your website files and database safely backed up.

Backup Your Website Using cPanel

Method 2: Backup Your WordPress Website Using a Plugin

  1. Log in to your WordPress dashboard
  2. Go to Plugins > Add New
  3. In the search field, type in All in One WP Migration
  4. Install and activate the Plugin
  5. Once the plugin is activated, go to All in One WP Migration and select Export To
  6. Choose File from the dropdown menu
  7. Wait for a few seconds till the export is complete, then click DOWNLOAD YourDomainName
  8. Your website is now backed up. You can save the file on your computer or any other storage you like

Backup Your WordPress Website Using a Plugin

Note: If you have WordPress sites, then skip right to Step 7.3.

You don’t need to create new databases, edit files, or any of that.

You need to download your website with All in One WP Migration, then upload it to the new WordPress site provided by your host using the same plugin.

That’s all there is to it! You can have your website migrated to a new host in just a few minutes.

Step 4: Create a New Database

Now that you have successfully backed up your website, it’s time to create a new database on the new web host server.

This is where your website’s content will be stored.

Again, we’ll be using cPanel for this.

  1. Log in to your new hosting’s cPanel
  2. Scroll down to the Databases section and navigate to the MySQL Databases section
  3. Click on Create New Database
  4. Fill in the database name and click Create Database
  5. You will be asked to create a username and password for the database. Make sure to use a strong password!

Create a New Database

Step 5: Import Your Database

Now that we have a new database set up, it’s time to import your old website’s database into it.

  1. Navigate to the Database section
  2. Click on phpMyAdmin
  3. Select the new database that you just created
  4. Go to the Import section
  5. Click Choose File and select the database backup file that you downloaded earlier
  6. Click Go to start the import process

Import Your Database

Step 6: Edit Your Website’s Files (WordPress, Joomla, and Drupal Websites Only)

If you have a dynamic website (most likely built with WordPress, Joomla, or Drupal) and download your website’s files via your cPanel, then you’ll need to edit your website’s files.

You see, when you downloaded your website’s files, they were still pointing to the database of the old server.

And we simply need to change that, so it points to the new database we just created.

Don’t worry it’s straightforward, and we only need to edit one file.

For this guide, we will assume that:

  • New Database Name: NewDB
  • User Name: User
  • Password: User123

Edit Your WordPress Site’s Files

If you have a WordPress website, the file you need to edit is the wp-config.php file.

Wordpress Logo

Here’s how to edit it:

  1. Make a copy of the wp-config.php file
  2. Open the file in a text editor such as Notepad
  3. Press CTRL+F and search for MySQL database hostname, then replace the old hostname with your new database name. In this case, it will be NewDB
  4. Repeat the same process for MySQL database username and MySQL database password. In this case, we will change them to User and User123 respectively
  5. Save the file

Edit Your Joomla Site’s Files

If you have a Joomla website, the file you need to edit is configuration.php.

Joomla Logo

Here’s how to edit it:

  1. Make a copy of the configuration.php file
  2. Open the file in a text editor such as Notepad
  3. Press CTRL+F and search for public $db, then replace the old hostname with your new database name. In this case, it will be NewDB
  4. Repeat the same process for public $user and public $password. In this case, we will change them to User and User123 respectively
  5. Save the file

Edit Your Drupal Site’s Files

If you have a Joomla website, the file you need to edit is settings.php.

Drupal Logo

Here’s how to edit it:

  1. Make a copy of the settings.php file
  2. Open the file in a text editor such as Notepad
  3. Press CTRL+F and search for database, then replace the old hostname with your new database name. In this case, it will be NewDB
  4. Repeat the same process for username and password. In this case, we will change them to User and User123 respectively
  5. Save the file

Step 7: Upload Your Files to the New Server

Now that we’ve edited our website’s files, it’s time to upload them to the new web host server.

Method 1: Upload Your Files Using cPanel

  1. Log in to your new hosting’s cPanel
  2. Navigate to the Files section and click on File Manager
  3. Locate and click on public_html
  4. Click on Upload
  5. Click on Select File, select the website’s files that you downloaded earlier, then click Open

Upload Your Files to the New Server Cpanel

Method 2: Upload Your Files Using Filezilla

  1. Log in to your new web hosting account
  2. Go to Files > FTP accounts
  3. Create a new user
  4. Download the FileZilla Client
  5. Open FileZilla and fill in the hostname, username, password, and port fields with the information from your FTP client
  6. Click Quickconnect
  7. Locate public_html and drag & drop or upload your website’s files into it
  8. That’s it! You’ve successfully moved your website to a new web host.

Upload Your Files to the New Server FileZilla

Method 3: Use WordPress Plugin

Remember the All in One WP Migration Plugin that we talked about earlier?

We can use it to upload both our files and database to the new web hosting server.

To do that, simply follow these steps:

  1. Install and activate the plugin on your new WordPress site (provided by the hosting service)
  2. Navigate to the Import tab
  3. Click Import From
  4. Select File from the dropdown menu
  5. Upload the export file that you downloaded from your old site
  6. Click Open
  7. And that’s it! You’ve successfully moved your WordPress site to a new web host

Use WordPress Plugin All in one

Step 8: Test Your Website

Now that you’ve moved your files to a new web host, it’s time to test it out.

This is your chance to ensure everything works as it should before you switch.

Here’s a checklist of things you should test:

  • Website speed
  • Images and other media files
  • Styling and design
  • Forms and contact pages
  • Broken links
  • Mobile responsiveness
  • 404 pages

Take your time to test everything and ensure that your website works perfectly.

If you find any issues, don’t hesitate to contact your new web hosting provider’s customer support.

Customer Support

To be honest with you, most of the time, the support will send you an article and tell you to troubleshoot the problem yourself, which isn’t very helpful.

For this reason, we put together a list of the most common errors you might encounter when moving to a new host and how to fix them.

1. Page Not Found Problem

The best way to find pages that aren’t working properly is by keeping an eye on your 404 log.

404 Page

You can view your 404 log by going to your Google Search Console > Diagnostics > Crawl Errors > Not Found.

Once you identify the pages that are returning a 404 error, you have 1 of 2 options:

  1. Show your visitors a custom 404 page
  2. Redirect the page to a working page

If you decide to show your visitors a custom 404 page, add the following code to your .htaccess file:

ErrorDocument 404 /newpage.html

Make sure to change newpage.html with the page you wish to show your visitors when there is an error.

If you want to redirect the page to a working page, add the following code to your .htaccess file:

Redirect 301 /previouspage.html http://yourwebsite.com/newpage.html

2. Redirecting Dynamic Pages

If you changed your site structure at the new host, you can redirect your dynamic page using this code.

RewriteEngine on

RewriteCond %{QUERY_STRING} ^id=13$

RewriteRule ^/page.php$ http://yourwebsite.com/newname.htm? [L,R=301]

3. Directory Not Found Problem

Similar to redirecting a page, you can redirect an entire directory using the Redirect directive.

Directory Not Found Problem

Just add the following code to your .htaccess file:

RedirectMatch 301 ^/category/?$ yourwebsite.com/newcategory/

4. Database Errors

Sometimes during website migration, your database can get corrupt.

Error establishing a database connection

This can be caused by several things, such as:

  • Error establishing a database connection
  • Interrupted connection during the migration process

The most common one is the Error establishing a database connection error.

If you encounter this error, you should first check your wp-config.php file to see if your database credentials (host, username, and password) are correct.

If they are, then the next step is to re-upload your database.

After all, that’s the main reason we made a backup of our files, right?

Follow the steps we discussed in the earlier section on how to do that using phpMyAdmin.

If you’re still having issues, then try one of the following methods:

Method 1: phpMyAdmin

  1. Go to phpMyAdmin
  2. Locate and open your website database
  3. Check the Check All / Check tables having overhead button
  4. Choose Reapair table from the dropdown menu

Method 2: WordPress Auto-Repair

  1. Go to your wp-config.php file
  2. Press CTRL + F and search for /** Absolute path to the WordPress directory. */
  3. Above this line, add this: define(‘WP_ALLOW_REPAIR’,true);
  4. Save changes
  5. Go to http://yourwebsite.com/wp-admin/maint/repair.php
  6. Click Repair and Optimize Database
  7. After it’s done, go to your wp-config.php file and remove the define(‘WP_ALLOW_REPAIR’,true); line you added earlier, then save changes

Step 9: Update Your DNS

Computers don’t understand words as we do.

DNS Servers

Instead, they use DNS (Domain Name System) records to translate human-readable domain names (like yourwebsite.com) into IP addresses (like 192.168.0.24).

Think of the DNS server as the internet’s phonebook.

Whenever you type a domain name into your web browser, the DNS will look up the corresponding IP address and connect you to the right website..

Right now, your domain name will be pointing to your old host, so we need to change that.

The process is relatively simple, but it’s different from one domain registrar to another.

But here is a general idea:

  1. Log into your domain registrar’s account
  2. Navigate to the DNS Management page
  3. Find the A record for your domain name and replace the IP address with the new host’s IP address
  4. Save your changes

Depending on your registrar, it can take up to 48 hours for these changes to take effect. But in most cases, the changes propagate within a few minutes.

Step 10: Move Your Email

If you have email accounts associated with your domain name, you’ll need to point them to the new server as well.

MX Records

The process is very similar to updating your DNS records:

  1. Log into your domain registrar’s account
  2. Navigate to the DNS Management page
  3. Find the MX record or @ record for your domain name and update the IP address to the new one provided by your web hosting provider
  4. Save your changes

Step 10: Cancel Your Old Web Hosting Account

Congratulations!

You’ve successfully moved your website to a new host.

But there’s one more thing you need to do: cancel your old web hosting account.

Cancel Hosting

You don’t want to keep paying for two web hosting accounts, do you?

To cancel your old account, log into it and navigate to the payment or billing section.

Most web hosts make it easy to cancel your account.

But if you can’t figure it out, contact their customer support and ask them to help you.

FAQS

What Is Website Migration?

Website migration is the act of moving your website from one hosting provider to another.

How Much Does It Cost to Migrate a Website to a New Web Host?

It costs $0 to migrate a website to a new host. You only need to pay for the new hosting environment.

Free

Can I Transfer My Website From Godaddy?

You can transfer your website from GoDaddy to any other hosting provider you like.

Can I Transfer My Domain Name to a New Host?

You can transfer your domain name to a new host, but it’s not necessary.

You can keep your domain name registered with your current registrar and just update the DNS records to point to the new hosting account.

Update DNS

Does Switching Website Host Affect SEO?

Switching web hosts will not affect your SEO. However, if the migration is not done properly, your website might experience some downtime, which can have a temporary negative impact on your SEO.

Plus, if the new host is not as good as the old one, your website might load slower, which can also affect your SEO.

How Do I Change Ownership of My Website?

You can change ownership of your website by:

  1. Providing the hosting and domain registrar accounts to the new owner
  2. Transferring the Domain Name to the new owner. This is often done by replacing the email associated with the domain
  3. Sending over your website’s files and databases

Conclusion

Moving your website to a new host doesn’t have to be complicated or expensive.

By following the steps in this guide, you can easily switch web hosts without any downtime or loss of data.

If you are looking for a new web hosting provider, check out our list of the best web hosting for beginners.

We spent many hours testing and reviewing different hosting providers to find the best ones for different budgets and needs.

Matt-Author-Img

Article by

Matt Diggity

Matt is the founder of Diggity Marketing, LeadSpring, The Search Initiative, The Affiliate Lab, and the Chiang Mai SEO Conference. He actually does SEO too.

Want to rank easier, higher and faster?

Sign up and join 30,000+ other subscribers and get SEO test results sent straight to your inbox.

moz sidebar

"One of the most effective SEOs I've ever met"- Cyrus Sheppard

As Seen On...

Search Engine Journal
New York Post
ahrefs brand