Ultimate Guide to Moving Web Hosts
Making the decision to leave your current hosting provider in favor of one that better fits your needs is a difficult decision. One of the things that often holds webmasters back from making a change is having to move a website from one host to another. Thankfully, switching hosts with minimal or even no downtime is possible.
The key is to research the process before you begin, plan your move carefully, and get your new host involved in the process to make the transition as seamless as possible.
Plan Your Move
The first step in the process of moving from one hosting provider to another is to carefully plan the move.
When selecting a new host, be careful and deliberate. Do your research. If you've decided to make a change, there's probably a good reason for it. Make sure you don't end up back in the same old situation with your new hosting provider. Do your research before signing up for a new plan.
Once you've selected a host, take the time to think through the migration process.
The most common hosting environment is a shared Linux server with MySQL databases and cPanel control panel. In this tutorial, we will show how to move a website between two hosts offering this environment. If your move involves a more exotic or sophisticated environment, make sure that there is full compatibility between your website files and database and the new environment you're moving to by talking to the new host's support department before signing up.
Think through the pieces of the website puzzle that you'll need to move and reassemble on your new hosting account. In most cases, the process will look like this:
- Copy website files and database from your existing hosting account.
- Upload website files and database to your new hosting account.
- Test your website on the new server.
- Point domain at your new host's name servers.
- Wait a few days to make sure that the new name server configuration has propagated throughout the DNS system.
- Close your old hosting account.
Copy Your Website Files and Database
Your goal in copying your website files and database is to grab a snapshot of your website as it is right now so that your visitors won't ever know that something changed behind the scenes.
One thing to keep in mind when copying your website files is that the directory structure matters. Whatever the structure of folders on your existing hosting account, don't mess with it. Download the website files exactly as they are, and upload them to your new account without modifying them.
If you do move things around or change file names you risk breaking internal links, or worse, your entire content management system.
Copy Your Website Files
There are a few different ways to copy your website files. One common method is to use an FTP client such as Filezilla to do the task.
Using FTP to copy your website files to your computer is a 4 step process:
- Create a folder on your computer where you'll copy your website files. In our screenshot below, we created a file called Website Files & Database and saved it to the desktop to make it easy to find.
- Connect to your existing hosting account using FTP and locate your website files. In most cases, they'll be in the public_html folder.
- Drag all of your website files into the folder you created and wait for them to finish downloading.
- Open the folder and verify that the files downloaded as you intended. If all is well, close the FTP connection.
Once the file has finished downloading it will be visible.
Copy Your Website Database
Next, you'll want to grab the database associated with your website. To do this, you're going to use a program provided by your current hosting provider. The most common type of database is a MySQL database, and the most common application for working with MySQL databases is phpMyAdmin.
If your website doesn't have a database, you can skip this step entirely and go ahead and upload your website files.
If your website uses a different type of database, such as a PostgreSQL database, then you'll need to use the appropriate application for that type of database, such as phpPgAdmin in the case of PostgreSQL databases.
To copy a MySQL database, go to your current hosting account control panel and look for PhpMyAdmin in your account control panel. Here's how the icon looks in cPanel.
Click on phpMyAdmin and you'll be logged into the application which you will use to locate the appropriate database and download a copy.
On the left-hand side of the window you will see a list of the databases in your account. Select the database for the website you are moving and click on it. Next, select the Export tab along the top of the window and then click the Go button to download all of your databases in SQL format.
Locate the downloaded SQL file and move it to the same folder as your website files to make it easier to find when you need it.
Set Up Your Website and Database on Your New Hosting Account
To set up your website on your new hosting account you'll need to do four things:
- Create a new database on your new hosting account.
- Upload your database tables into the new database.
- Modify your website files to reflect your new database name and credentials.
- Upload your website files to the server.
Setup a New Database
Depending on how your hosting account is configured, you will create a new database using either phpMyAdmin or the MySQL Database Wizard. Using the wizard is a little more user-friendly and intuitive, so it's the method we're going to demonstrate.
First, find the wizard in your new hosting account cPanel.
In the following screen you'll enter a name for the new database. You can use any name you like.
On the next screen, create a user and password for the database. It's a good idea, though not mandatory, to use the Password Generator to create a strong password. Just be sure you save it somewhere secure so you can find it when you need it.
At this point it's a good idea to make a note of the database name, username, and password. Once you've securely saved those where you can find them again easily, click Create User.
On the following screen, select the ALL PRIVILEGES checkbox, and click Next Step.
On the next screen you'll see a success message letting you know that the user you created has privileges in the database. Your database is now set up and ready for you to import the sql data you downloaded from your previous host.
Upload Data to the New Database
Head back to your cPanel interface and select phpMyAdmin. Now you should be able to locate the new database you just created in the sidebar on the left-hand side of the window.
Select the database you just created and click the Import tab along the top of the window. On the Import page, select Choose File and select the database file.
Once you've found and selected the database file, scroll to the bottom of the page and click Go. After a few seconds, you will see a message letting you know that the import was successful.
Modify Website Files
If your website consists of both website files and a database, you will need to modify your website files to connect them to the database you just created.
The file you will need to modify to connect your website and database will vary depending on the software you're website is built with. Here are the files you will want to look for if you're using one of the three most popular content management systems:
- WordPress: wp-config.php;
- Joomla: configuration.php;
- Drupal: settings.php.
Here's what the changes will look like in WordPress.
If you're working with Joomla, the configuration file looks considerably different.
Drupal looks more like WordPress than Joomla does, but the order and format are a little different so pay attention as you enter your database, user, and password details.
Now save the changes you've made and close the file. If you're using different software to power your website, you will need to refer to the documentation that applies to your software to locate the correct file you will want to modify.
Upload Your Website Files
You're now ready to upload your website files. The easiest way to upload the files is to use an FTP client. If you've never used FTP to connect to your new hosting account, you'll first need to create a new FTP user. Head back to your new hosting account control panel and look for the FTP Accounts icon.
Follow the instructions to create an FTP user, and then use the information provided by your hosting provider to connect your FTP client to your new hosting account.
Next, locate the public_html folder and drag your website files into it.
Remember, you must maintain the same directory structure when uploading your website files. So if your website files were contained directly in the public_html directory on your old hosting account, put them directly into the same directory on your new hosting account. Likewise, if your website files were contained in a subdirectory inside of public_html, mirror that directory layout on your new hosting account.
In the case of our example, all of our website files are contained inside of a directory called wordpress which was a subdirectory of public_html. So when uploading the files to the new account we would upload the entire wordpress directory to the public_html directory so that the resulting file path looks like this:
Guides for Moving Specific Types of Websites
The process above is a basic explanation of how to move files and databases for most common websites in a shared hosting environment. However, there are many application-specific guides that will provide more detailed instructions that are unique to the application that powers your website.
Here are a few of the most popular website applications and the documentation you should review prior to moving your website:
- WordPress Codex: Moving WordPress
- Drupal Community Documentation: Migrating a Site
- Joomla! Documentation: Copying a Joomla Website
- phpBB Knowledge Base: Transferring Your Board to a New Host or Domain
- MediaWiki Manual: Moving a Wiki
Test Your Website Before Going Live
Ideally, you will test the connection between your website and database before going live with your website hosted by your new host. However, doing so is an advanced technique that we can only describe at a high level because the process varies from one content management system and hosting provider to the next. Get in touch with your new hosting provider if you need help with this step.
If you don't test the connection before pointing your domain at the new hosts nameservers, then plan the transition from your old host's nameservers to your new host's nameservers for a time when your website experiences low traffic. For many websites, late at night over the weekend is a good time to plan a transition. Study your website visitor statistics to pinpoint the best time to make the change with minimal disruption in the event that something goes wrong.
You will need to do two things to access your website before going live:
- Determine how your host enables temporary URLs and formulate a URL to access to your account.
- Adjust your website configuration details, which may be stored in a configuration file or in a database table, to reflect the temporary URL.
Your host may provide documentation that contains the information you need to formulate a temporary URL. If you can't find documentation you need, contact your host's support department for assistance.
In most cases, your temporary URL will look something like this:
The first part of the address is made up of your server's direct address and the second part is your control panel username preceded by a tilde. You can find your server's direct address in the Account Information portion of your cPanel interface or by contacting your host's support department.
Once you formulate a temporary URL and modify your website to work at the temporary URL, visit your site. Your goal is to confirm that the connection between your website files and database has been made successfully.
Once you have determined that the connection between your website and database is working correctly, go ahead and change back the website configuration details to reflect the permanent domain where the website will be found.
Create a New Domain
Before you can point your domain name at your website hosted on your new hosting account, you'll need to create a record of the domain on your new hosting account. In your hosting account control panel, find the Addon Domains icon.
When you create the addon domain, use the URL where you want the website to be found. For the document root, be sure to use the folder where you have uploaded your website files.
Create Email Addresses
Before switching your domain name servers you will want to recreate any email addresses currently receiving mail at your old hosting account. If you don't set up the email addresses prior to pointing your domain at your new hosting account, some incoming email could be lost.
In your hosting control panel, look for the Email Accounts icon.
From the next screen, go ahead and recreate any email addresses receiving mail on your old hosting account.
Update Your Security Certificate
If your website is accessed over https, you will need to install your SSL certificate on your new hosting account to continue using it. In most cases, you will need to have your new hosting provider assist you in installing the certificate. Check with your new host about the logistics of installing your existing SSL certificate, and be aware that you may have to fork over a few additional dollars to have your host complete the installation for you.
Update Your Domain Nameservers
Now that you've set up your website and tested it, and set up your email inboxes, it's time to point your domain name at your new hosts nameservers. Go to your hosting account control panel and look for your hosts Name Servers. They should look something like this:
Now head to your domain name registrar's website, login to your account, and add your hosts domain name servers to your domain.
What happens next is that your domain name registrar will begin sending out updated information to all of the servers that make up the domain name system (DNS). This process is called propagation and it may take up to 24 hours for the information to propagate to all of the servers in the system. Until propagation has completed, your website needs to be accessible on both hosting accounts.
Transfer Domain Names
Your domain name is registered and renewed with a domain name registrar. Your website is hosted by a hosting provider. In many cases, your hosting provider and domain name registrar may be the same company. However, that certainly doesn't have to be the case.
If you are wrapping up the process of moving from one hosting provider to another you now have the option of moving your domain name registration to your new hosting provider, or leaving it with your current domain name registrar.
If you feel it would be simpler to have your domain name and hosting managed by the same vendor, you can easily transfer the domain name registration to your new host. In order to do that, you will first need to go to your current registrar's website, login to your account, and release the domain name for transfer.
Once you've released your domain name to transfer to your new host, go to your new hosts domain name transfer feature.
From this point, the process will vary depending on who you are hosting with. There will be a fee to process the transfer, but in most cases your new registrar will also tack on an additional year of domain name registration.
Follow the instructions provided by your host to finish the transfer and then verify that the domain name is pointing at the correct folder on your hosting account.
Cancel Your Old Hosting Account
Once you've finished the process of transferring your website to your new hosting provider, it's a good idea to wait at least one or two full days before canceling your old hosting account. Run your domain name through a tool to verify that domain name changes have propagated throughout the DNS system before closing your old account.
One of the easiest tools to use for this purpose is our own hosting discovery tool. Simply go to our homepage, enter your own domain name in the search prompt, and click Search. In the results, take a look at the nameservers. You should see your new host's name servers. If you don't, then your domain is not pointing at your new hosting account yet.
If it's been less than 24 hours since you set your domain to your new hosts nameservers, you may just need to wait a little while longer. If it has been longer than 24 hours, head to your domain name registrars website and verify that you've properly assigned your new hosts name servers.
If everything appears to be in order, you've waited more than 24 hours, and your domain still isn't pointing at your new host's nameservers, you need to get in touch with your domain name registrar to further troubleshoot the issue.
Once your domain is pointing at your new hosting account website visitors will be visiting and interacting with your site on its new server. At this point, you will need to contact the customer service department of your old hosting account and officially notify them that you wish to close you hosting account.
Note that most hosting accounts are set up to automatically renew at the end of the current term. So be sure to get confirmation from your old hosting provider that the account has been closed and will not be renewed.
Instructions for Specific Hosting Providers
Many hosting providers offer an extensive knowledgebase with information about many of these topics. Use the links below to find the information you're looking for that is specific to your hosting provider.
- 1&1: Transfer Domains
- A Small Orange: Leaving Your Old Host and Move to A Small Orange
- A Small Orange: Check That Your Nameservers Were Set Correctly
- Bluehost: Transferring Away From Bluehost
- Bluehost: How to Transfer a Domain
- Bluehost: Domain Registry Transfer to Bluehost
- Bluehost: How to Change Your Nameservers
- DreamHost: Uploading Your Site
- DreamHost: Nameservers
- DreamHost: Move WordPress to DreamHost
- eHost: How do I point my existing domain to my account?
- GoDaddy: Move Your Website to GoDaddy
- GoDaddy: Preview Your Website Using Host Files
- GreenGeeks: Shared Hosting Site Migration Instructions
- GreenGeeks: How can I test my website before switching DNS?
- HostGator: Website Transfer Articles
- HostGator: How do I move with no downtime?
- HostGator: Temporary URL
- HostGator: Can I transfer my current SSL to my new hosting?
- HostPapa: How to transfer your domain to HostPapa
- HostPapa: Domain Server Setup & Transfer
- InMotion: How to Migrate Your Website From Another Host to InMotion Hosting
- InMotion: How to Migrate Your Website From Another Host That Uses cPanel to InMotion Hosting
- InMotion: How do I transfer a SSL certificate from my previous hosting company?
- JustHost: Transferring Away From JustHost
- JustHost: Pushing Website from Old Host to JustHost
- JustHost: FTP, Uploading a Website
- JustHost: Moving Hosting and Minizing Downtime
- JustHost: Nameservers
- MyHosting: Transfer Your Domain Name and Website
- Site5: Migration From Another Host to Site5
- Site5: Another Host to Site5
- SiteGround: How to Transfer Your Site Content to SiteGround
- SiteGround: How to Transfer my Existing Domain Name to SiteGround
- SiteGround: How to use Your Existing Domain with SiteGround
- SiteGround: How to Transfer the SSL From the Previous Host
Moving from one hosting provider to another can be a bit daunting. However, now that you know the steps necessary to successfully navigate this transition you're ready to make an informed decision about how to proceed.
If you're stuck with a host whose services you've outgrown, or if you're just ready to try out a more robust feature set, don't let the process of moving a website stand in your way. The key is to look before you make the leap, understand the process, get help when you need it, and make the transition slowly and deliberately.