Admit it; we all have come across this website migration issue at least once with our WordPress website. I can relate to your pain as I have been this situation before.
You may want to switch your hosting because of technical issue you were finding with existing provider. Some may find the lack of technical support, and server issues a reason to switch the hosting provider. And in some scaled hardware resources and higher availability is the concern to switch hosting provider.
The reason may be any of these, but the migration process remains the same. Easy and more organized. In this post, I will try to reduce your stress and frustration. All you need to do is just follow the steps mentioned in this actionable post, that’s it.
In this article we will cover the faster and old school way, I call this approach The CPanel way. Because in this way, we will be dealing with CPanel based tools. Let’s get started without wasting much time.
This approach requires five straightforward steps to get the job done:
Backup website data
Restore website data
Create and restore database
Backup site data:
It’s by far the simplest way of migration. Nothing fancy included or welcomed here. The speed of migration process in this way depends on your website size and internet connection speed.
This process requires a bit familiarity with CPanel; generally most shared Linux hosting comes with CPanel for hosting administration. If you are familiar with it the process will be very easy for you. Don’t worry if you are not, I’ll cover everything with visual actions.
Login to your hosting CPanel. Don’t know to bring the CPanel? Just enter your DOMAINNAME.COM:2082 OR DOMAINNAME.COM/CPANEL and it will bring the CPanel login page. Please enter your credentials and log in.
Once you login to your CPanel you will see a page listed with various hosting related actions you can take. All the actions grouped nicely under a category. We are more interested in Backup which falls under Files category.
As highlighted in the image you need to press Backups link and it will open a page. I assume you have yours only website hosted on the server.
Pressing the Backups link would bring a new page where you can take two actions. First, you can take a full backup of all files hosted on your server and the second is to take backup of your WordPress website database.
Press the Download button. This will make a gzip compressed backup of all your files and folder on the root directory and prompt you to download it. Here is how prompt window may look like:
Select the Save File option and hit the OK button. It should start to download the backup file. The time will depend on the number of files, size of files and speed of your connection.
After the download completes, run the 7zip or likewise extractor to extract the source files and folder out from backup.tar.gz file. The final extracted source should display the source files and folder list.
Let’s take the database backup now. On the same page under the files download, you will have a list of available Database backup. Following is the image how it looks like:
Please find your active database used by the WordPress website. In most case, if you are hosting only one site on the server you will have single database listed here. Please click on the database link and click OK on the download prompt.
Once downloading done, we have a complete backup of your website now. It contains everything till the last moment you pressed the Download button.
Restoring website data:
In most hosting migration process the user seems to have purchased the hosting space but the domain’s DNS forwarding is pending. In those cases, you need to access your hosting server via IP address and provided credentials. Generally, these details are emailed to you once you check out the hosting space order.
Additionally, the new hosting account email would also contain the FTP information. We will use that information to connect to your new server and restore the backup file and folder from the previous step. If you don’t have FTP information you need to create a new FTP account.
To create new FTP account, please log in to CPanel on new hosting. How would you do it? Simple, enter “00.00.00.00:2082” the zeros will be replaced by your hosting account’s IP address. Next thing is to create a new FTP account on your new hosting server.
You need to click the FTP accounts on your CPanel page. It will bring the FTP user creation window. Please fill all the required fields in the form and you are good to go.
Download and install FileZilla FTP application on your computer. The application interface should look like the image below:
You may already have your server’s IP address, FTP username, and password. Meaning you have everything in pace but you need to focus on Local site (Path to your website backup files) section.
Do you remember we have extracted the backup files in the previous step? That you need to navigate to that directory where you can see the list of source files and folders of your backup website.
Next? A little sweet step to start restoring process, selected all the files and folders from local site section (can you see the Filename, File size, File type? I’m talking about the files, folders listed in that area.), right click there and choose the upload option. The automatic upload process will start.
If you are wondering why I haven’t suggested you the CPanel file upload way? Well because sending multiple or large size files over HTTP is pain and frustrating process. Why not go on a way where an application does the same thing.
Create and restore database:
So before creating and restoring the database, we first need to create a database user. Let’s create it. Login to your new server’s CPanel if not already logged in.
Press the MySQL Databases to link and it should bring you to the new page. Scroll down the page till you find the MySQL users section. Create a new user with desired username and strong password as shown in the image below.
Once you create the database user, it’s now time to create a new database on your new hosting. Be on the same page and scroll up till you find the new database creation form like shown in the image below:
Enter the name of your database and hit Create Database. Once database created go to the “Add user to database” on the same page as shown in image below:
You need to pick the database user and database we just created from the respective drop down menus and hit Add. Important: When asked to select All Privileges option checkbox and hit save.
Go to CPanel home and choose the phpMyAdmin as shown in the image below.
This will bring a new page of phpMyAdmin where you can manage your database from web panel.
Please select your database from left navigation area. Then select the Import from the header navigation area. This will bring the page shown in the image above. Click the Browse and select the database-backup.tar.gz file you downloaded from the old hosting server. Scroll down the page and hit the Go button.
That’s it! You have successfully imported all the pages, posts, meta and other plug-in related data information into your new server.
Please check the FileZilla FTP file transfer status, it may have completed the file transfer. If not wait for it. Now you have both the files and database restored on the new hosting server. One last thing left?
Still, something left? No, not a major issue it’s a change of three lines to your new wpconfig.php file. Go to your new server’s CPanel file explorer and locate the wpconfig.php find the configuration area shown in the image below (should be somewhere around 23-24 line).
Well, that’s it! You have successfully migrated your WordPress website to new hosting. Now all you need to do is forward your domain’s name server to your new hosting’s address. This is probably the fastest and minimum downtime approach for hosting migration.
As you can see, WordPress website hosting migration takes three easy steps. If you have website backup in place you may need only two steps for complete migration. Got any question or confusion? Please let me know in the comment section below.
Darshan is a founder of AlphansoTech a WordPress development company. He regularly writes a detailed article related to WordPress. You can connect with him on various social media platforms.