Migrating a website from one host to another can be real pain, especially if you haven’t tried it before. It can lead to loss of data, drop in rankings, and it could totally screw up your site. Luckily, if you do it right, none of this will happen – and this is what this post will help you with.
If running a WordPress-based site, you have, of course, the option to use one of the many WordPress migration plugins out there to automate the process as much as possible. They can, however, be quite expensive or pose a lot of limitations in their free versions (I’m specifically referring to my experience with WordPress Duplicator, one of the most popular migration plugins). They can also be quite intricate to use, contrary to what their developers claim. The reason simply being that automating WordPress site migration can be trickier than many believe.
If your site isn’t WordPress-based or uses one of the – if you ask me – horrible and restrictive custom made templates that don’t allow you to do anything without paying a fortune to your site’s designer, you can’t use plugins. In such cases, you have to migrate your site to another host (server) manually.
This post will guide you through plugin-less site migration via cPanel backups and FTP (file transfer protocol). If your host doesn’t use cPanel, scroll directly down to find the section on site migration via FTP.
The Step-By-Step Site Migration Guide (cPanel)
Important before you start
Do not cancel your current hosting account until completing the transfer and confirming the new installation to avoid loss of files and downtime!
Do not redirect your domain until all files are in place and the databases are re-connected!
Do not delete or alter the Home directory files on your current hosting account before your domain has been set to point to the new name server and has propagated to avoid downtime!
Log into your cPanel or similar server management software
Use your credentials to access the server as the first step in the process.
If you have forgotten your login details, you can contact your hosting provider and ask about them. As a rule though, they are the ones you chose when creating your hosting account¨. They are often sent to you in the welcome mail.
Start the Backup Wizard
The Backup Wizard is placed in the Files section on your Home screen in cPanel. If the screen isn’t folded out, you should simply click on it to fold out and access the different options.
If you have created backups previously, you can find them in the section Backups. However, if you have updated your site since the last backup was generated, you must create a new one to make sure your website’s copy and settings are current.
You can create a single full backup or multiple partial backups. It’s recommended that you contact your new hosting provider and hear, whether they can do the whole job for you (some offer site migration, even for free) or what kind of backup works best for them. Some want you to upload a full backup and then restore it for you. Others prefer that you upload partial backups and, in some cases, restore them yourself.
No matter which is the case, if you have to create a backup, you can do it via the Backup Wizard. The first step is to choose the Backup option in the Backup Wizard.
If you have to do a full backup, it’s easy. Simply choose the Full Backup option and follow the process. As it might take long time to create a full backup, you’re offered to receive a link to the file in your mail, as soon as it’s ready. Download the file and save it on your computer.
If you’re required to upload partial backups, choose to back up the Home Directory via the link under Partial Backup. This directory that contains your site’s files, including WordPress, text, themes, design, plugins, uploads, and settings. Save the file on your computer.
If your site uses databases (most do, even the simplest WordPress blog), go back in to step 2 in the Backup Wizard and choose to download your databases by clicking on the MySQL Databases under Partial Backup. Databases are usually downloaded one by one, so make sure you download them all and put them safely in a single folder to be able keep track of them.
Last but not least, if you have set up email addresses, go back again to step 2 in the wizard and download Email Forwarders and Filters.
Be aware that while the backup of your databases and email forwarders happens instantly and you’re directly prompted to download them, the creation of the backup of the Home directory takes some time. You can choose to receive an email when it’s ready for download. You can also find the file in the Backups section of your cPanel’s Home screen.
Save all files to your computer in a way that makes sense for you, for example in one or a few specially dedicated folders. You shouldn’t open or unzip the files as they are packed as required for upload to your new cPanel-based host.
Upload the files to your new host
To upload the files to your new host, you should follow the same steps to log into cPanel, find the Files section, and open the Backup Wizard. This time though, you should choose the Restore option in the Backup Wizard.
The restoration process begins by uploading your Home directory backup file.
To restore MySQL databases, you have to create them first. See how in the relevant section below.
Upload your Email forwarders and filters, if relevant. As long as you don’t have too many active emails, you can choose to simply create them again. When ready, remember to reset your email applications using the new credentials and name servers.
Now, you’re ready with the upload part of the restoration process and can move to reconnecting your site with its databases.
The process of recreating your MySQL databases begins by creating new ones in your new hosting account. This is done via the MySQL Database Wizard in the Databases section of the Home screen in cPanel.
Click on it and start creating databases by following the instructions.
Name the database as it makes sense for you. Remember to write down the name of the database and, in case you have multiple databases, what it’ll be connected to (WordPress or additional software).
Once a database is created, you have to create a database user. Choose a name you find fitting and a strong password. Write them down together with the name of the relevant database. As a part of the process, you have to edit user privileges. Give full rights to your new user.
After creating the new databases, you’re ready to import the ones from your old account.
You do that in phpMyAdmin, found on the Home screen of cPanel. Follow these steps to complete the import:
- Find the database, you just created, on the list to the left of the screen.
- Select the database you want to import to by clicking on it. Wait, until it loads.
- Once you can see it’s contents (it should be empty), click on Import in the top menu.
- Double-check whether you are importing into the right database. Choosing wrongly can destroy existing websites on your account.
- Browse your computer to find the backup database file and select it.
- Click on Go at the bottom of the page.
- Wait until a success message appears.
Database names, user names, and passwords matter so keep track of them! When ready with the setup and restoration of databases, you should make sure that the settings for database connections are changed accordingly in WordPress and all additional software using a database! If not sure how to do that, you should ask your software provider for assistance.
To reconnect WordPress to a database, you have to edit wp-config.php. You can find this file on the server, in the Home directory (Public_html). Download it either via FTP or File Manager. Open it with a simple text editor and find the following lines (where instead of ‘database-name’, ‘database-username’, and ‘database-password’ you will see the name, username, and password values for your old database):
Change the values to your new database name, username, and password. If you aren’t certain what value you should assign to ‘DB_HOST’ and setting it to ‘localhost’ doesn’t work, try contacting your new hosting provider and ask them for assistance.
When done with all edits, save the file, upload it again to Public_html, and choose to replace the existing one on the server.
Tip: When working with many databases, you might lose track of them. If you’re in doubt about which database should be connected to WordPress, you can check the current value in wp-config.php and use that as a pointer, as long as you kept the names similar.
Check and test
Check whether all files are in place in your Home directory and all databases are restored and connected properly.
As your domain still points towards your original site/WordPress installation, you can’t check the new installation for errors when live. To check whether everything works as it should, without risking to send visitors to a not working site, point a test domain or subdomain to the new name servers (you get name servers info, as well as instructions on pointing a domain to them in the welcome mail from your new provider). If you don’t own a special domain dedicated to website tests, it’s a natural – and cheap – option to create a subdomain and use it to test your pages. In the section on DNS, you can learn how to point a domain to a name server (your site).
As domain propagation can take up to 72 hours, testing your new installation can take time. Plan for it.
The actual test of new WordPress installations consists of visiting the site’s URL with /wp-admin appended to it. If everything went well and you connected the database successfully, you should be met by a login screen.
If this is not the case, you should retrace your steps and check for errors, starting from the wp-config.php file and the lines you edited.
If no issues are detected on the backend, check the frontend of the site. When you have been able to confirm that your migrated site functions as intended, you’re ready to make the final move and redirect your domain.
Edit DNS (Domain Name Servers)
You point your domain by editing its DNS records. If you have access to domain management, you should simply delete your old name servers and replace them with the new ones, as provided by your new hosting company.
If you don’t have direct access to domain management, which often is the case when you register a domain via a hosting provider, you should contact customer service and ask them to edit the DNS records for you.
Sometimes, domain propagation takes no more than a few hours. It can, however, take up to 72 hours. As long as you do it via customer service, you can expect additional delays due to work overload.
In order to avoid downtimes, it’s important to confirm that the domain has propagated before removing the files or closing the account on your old server. You can do this by using a DNS check tool, revealing the name servers, associated with a domain name. If the new name servers appear, the domain has propagated and your new installation is now accessible online.
Now you’re all set – the migration of your site has been successful and you’re ready to say goodbye to your old host. Do it quickly, as in some cases you can get refund for your remaining contract period.
Migrate Your Site Using FTP
To migrate a WordPress or other site using FTP, you have to start by setting up your FTP client. You’ll need to have a FTP account both for your current and new hosting account.
When done with this step, access your current server via the FTP client and download your entire Public_html (Home directory). Save it as it is on your computer.
Next, access the server to which your site is migrating via the FTP client. To the left of the screen, you can see the tree map of your local files. Locate the downloaded Public_html directory and open it. Now, in the window below (if you feel lost, check out the suggested post on FTP setup above for screenshots and detailed explanation), you can see all of folders and files from the Public_html directory. Select all files and folders from it and drag and drop them into the existing Public_html directory on the server.
Note! As long as it’s a new hosting account, the Public_html directory will be empty, which is optimal for such a migration. It can, though, have some contents. Make sure you don’t overwrite something critical! If in doubt, ask your hosting provider.
The upload and the download take up to a few hours, depending to the size of your site and the speed of your connection, but you should in all cases be prepared to use a at least a whole day on the migration.
Now that your files are in place, you can take the next step by creating and importing your databases, as described in the MySQL Database section above. If you don’t have access to phpMyAdmin or a similar tool, please ask your new hosting provider how to handle the database transfer. As a rule, you should use the same tool on both servers to avoid compatibility issues and errors.
If you don’t at all have access to software, allowing you to edit and download databases, you need help with that. Contact your current hosting provider and ask them to assist you with getting a copy of the MySQL databases in the format required by your new hosting provider.
When the databases are successfully transferred, reconnect WordPress and eventual additional software, as described in the MySQL Database section.
When ready, you should test your new installation. Do that as described in the Check and test part of this post.
The last step is to edit the DNS records for your domain (check out the Edit DNS section above) and wait for it to propagate.
Get Help With Site Migration
Many hosting companies offer to help you migrate your site onto their servers – and most offer it for free. There’s generally no reason to not accept their help with it, as long as your site or current hosting account doesn’t host confidential data. Only in such case you must take care of site migration yourself.