How to migrate a website from a host to another or from local computer to a remote server? It is actually not difficult to move over your sites to new servers. Check out your website properties, you need to know how many stuff you have to move. Basically how many web pages and databases you have, how to download them to your computer, and finally how do I upload them to the new servers. Please note some websites may not have any databases, also sometimes you may have emails hosted with your previous hosting. A static site with just static html pages, no databases unlike a dynamic database-driven site. If you do not have any databases, you can only migrate the web pages. If you have emails hosted, you may want to download the old emails and migrate emails to the new host as well.
Great news for Control Panel software users, such as Plesk, cPanel, Ensim, or Hsphere. For example, if both your last and current hosting service providers are offering cPanel as their hosting control panel, you can migrate all your sites including web pages, databases, emails and so on much easier. With a cPanel service, you can go to out last hosting to generate a whole back up, after that you will get a URL to download the backup generated. Once you get the backup file onto your local computer, just upload it to your new hosting then contact your new host to import the backup. Check out this guide for the instructions: Create Full Website Backup In cPanel.
You may also be able to use the built-in Migration Manager or counterpart facilities to move sites from other hosting companies – if they use Control Panel software such as Plesk, cPanel, Ensim, or Hsphere. There should be equivalent free migration tools, contact your web host or double check your hosting control panel. If you subscribed a web host who provide free website transfer or migration service, like Arvixe hosting, check out this guide: Free Website Migration Hosting
How to Migrate Website Manually by Yourself?
Here is the general process to migrate a website from your old host to new host.
- Back up all website content, databases, and emails from your current host.
- Upload files and import your databases to your new hosting service
- Download emails from old host if any, re-create existing email accounts with new host.
- If need, update database connection strings and system paths to match the new hosting environment.
- Test the site hosting on new server using your IP address.
- Change domain DNS settings.
- Test your site on new server using your domain.
- Double-check migration accuracy, cancel old hosting service.
Below, we will go into more detail. Throughout this guide we will mainly focus on basic instructions, there are some more advanced instructions related but they might require another new guide, so we will just give a very brief intro to those advanced aspects.
Backup Website Content with old Host
You can use FTP client such as filezilla to connect to your FTP server and download your website files. Your web host might provide web based download or backup tools as well. Log into your old host, look for such a tool in their hosting control panel and download all the files for your domain to your local computer. For advanced users, you can also use the SSH command SCP to transfer files from your old host directly to your new host. For cPanel hosting, refer to this page: backup websites in cPanel.
Backup Databases with old Host
If you have a dynamic database driven website, you will need to move that database over also. There are a variety of ways to back up a database. A simple way is to use phpMyAdmin to export MySQL databases. If you are familiar with the shell, it is another way to back up our databases. Also for different databases types, you might need to use different ways to back them up. For example, for MSSQL database and Windows hosting, you can refer to this tutorial to back up MSSQL database.
Now that you have a complete backup of your site files and database. In following steps, we need to move them to the new servers with our new hosting provider. Since you have finished the backup of the site and you know how to use the backup tools. The following steps should become much easier for you as basically you only need to use the same tools to restore or upload the backup files to the new host.
Upload Website Content to new Host
Connect your new server space via FTP client, such as FileZilla, to upload your old website files to the new host.
Upload or Restore Databases to new Host
Now we need to create new database in new control panel and import our database backups to the new database created. cPanel the most popular hosting control panel solution for PHP Linux hosting service. See how to create database in cPanel here. For MySQL databases, importing via phpMyAdmin is the most popular way to upload your database. This tutorial shows you the steps to restore MySQL database through phpMyAdmin. If you are using a Windows hosting service, you can refer to this guide to create MSSQL database and restore MSSQl server.
Update Database Connection Strings
Any website that utilizes a database needs to be able to make a connection between the web front and the backend database. When moving to a new host, it is important to know where your database connection strings are located so you can update them to work with your new environment. Basically the Database Connection Strings contains info such as database ip, username, password, etc. For convenience, check out this example: How to edit WordPress database connection?
Preview and Test website on the new hosting server
Now we have migrated over our website stuff from the ld host to the new host. However our domain name is still with our old host or our registrar. Thus we cannot test our site on the new hosting server with the domain.
Almost every hosting company includes the ability to test your site using a IP Address or temporary shared URL. The IP address or URL is available in your new hosting control panel and Hosting Service Activation Letter. Contact your new host if you can not find it. Make sure your website is up and running before we go to transfer your domain over to the new hosting.
Change Domain DNS settings with domain registrar
When you have finished the testing on the new hosting server, you are ready to point your domain to the new hosting server. Your new host will provide you with name servers. You can go to update the name servers with your domain registrar. If GoDaddy is your registrar, see this guide: how to change Name Servers with GoDaddy? An alternative to the name server change, you can also edit your domain’s DNS record to point it from your registrar to hosting. See an example here: Steps to Add or change A record in DNS with GoDaddy.
There might be a temporary downtime caused by the DNS update as it takes sometime to propagate over the Internet, it may last from one to three days. Sometimes it could be very fast, just hours or even minutes. So a good practice is not to update the DNS at the business hours, choose the time when you have the least visitors.
Now you know how to migrate website manually. If you are still not comfortable with the manual site migration, you can contact our new host see if they offer website migration service. In fact, this should be a service offered by many hosting companies, some of the hosts provide Free website migration service, some may require a one time fee.