By | May 30, 2019

Migrating a WordPress site from one host to another is a very easy task if you follow all process carefully. Website migration should be a straight forward process and even if you face a problem or two you should be able to tackle it easily on your own.

In this blog, you’re going to learn how to migrate a website to another hosting without any issue and domain name, avoiding many of the common problems experienced with migrations.

Note: There are many ways to approach a migration, in this tutorial I’ll be introducing you to a manual approach. which is very easy and successful to migrate a website in a few steps.

Part One- Take backup of home directory and database (We only need two backup)

Part Two- Restore both backups- home directory and database to new hosting.

Let’s Start from Part One (Backup of Website)

Deactivate All Plugins:

Before you begin, I’d recommend that you deactivate all plugins because, when moving a WordPress site to a new host, the things that are likely to fail are your WordPress plugins. WordPress itself is well designed to adapt to new changes, but the plugins might not be.

Therefore, to deactivate all activated plugins, go to the admin page -> Plugins -> Installed Plugins -> Mark all -> Bulk action -> Deactivate -> Apply

Backing up WordPress Database and Home directory Files:

It’s best practice to always backup your website before making any changes, and a WordPress migration is no exception. There are a couple of WordPress plugins for doing this, but a manual approach is best if you want to be in complete control of the process.

Now, I’ll show you how to backup your WordPress files and database with a manual approach.

Take Backup Manually:

Database Backup:- To back up your WordPress database manually: Log in to your phpMyAdmin, click on your WordPress database and select Export as shown in the image below.

Ensure that you’re exporting in SQL Format and click Go. Your WordPress database will then be downloaded as a .sql file. I recommend that you save the downloaded SQL file to a special folder on your computer so that you can easily locate it later during the restore process. You can also use the command line to export a copy of your database.

Website Home Directory Backup:- To backup your home directory files manually we would recommend you to download your complete WordPress installation folder so that you won’t lose anything.

If there is only one website running in your hosting, please zip all your public_html folder (or anywhere your WordPress installation resides) and download the same to upload to the new hosting home directory.

In my example, I am taking a backup of my blog site. go to the cPanel-> File Manager-> Click on the home directory  in left window->Select All file in the write window -> Click Compress

Give a location and file name to compress all home directory files in the zip format and Click Compress Files.

Now Download the zip file to a special folder on your computer so that you can easily locate it later during the restore process. We have successfully taken and downloaded both backups 🙂 

Let’s Start Part Two Now to restore the website to HOST2BOOST!

Step-1, We will Import the database which we have exported from old hosting-

a) Go to cPanel and search backup, you will see one Backup Wizard Icon. Click on Backup Wizard to open Backup wizard. Please click Backup and then MySQL Databases to restore MySQL backup which we had downloaded from old hosting.

b) Now Select database file to restore and click on Upload button to finish the restore process.

c) Go to cPanel and Search ->phpMyAdmin and Click to Open -> Verify that backup has been restored and all tables are there (Click on the database and see database tables in right side panel)

d)Now we need to to create a user to give access to the database we had restored. Go to cPanel -> Search MySQL Database and click to Open. Scroll down and you will see below screen. Give a user name, password and click on Create user. (We have given same user name as the database to keep remember easily)

e) In this step, we will add a user to the database. So on the same page, you will see below screen. select your database and correct username if there are more than one user and Click Add.

f) Once you click on Add you will get one screen as showing below. Select All Privileges and Scroll down to Click Make Changes.

Now our user has been assigned to the database with all the privileges and we are done with database restore part.

Step-2, In this step we will restore website home directory which we have exported from old hosting-

a) Go to cPanel-> Open File Manager -> Select Public_html or anywhere your home directory resides ->Click Upload to upload the backup.

b) Upload the website home directory backup and Extract to the home directory at new hosting.

c) Once backup successfully uploaded we need to extract it to the home directory at new hosting.

d) Once Click on extract it will ask a location to extract all files. Select the home directory and click Extract Files.

e) Find the extracted folder and open it to move all files to the home directory. Click on Extracted Folder-> Select All files and folders-> Click on Move->Select Home Directory (Pubilc_html or whichever you have) and Okay. 

f) You will see a prompt to select a directory to move the files, Select your home directory and Click move.

We are done with the backup restore process, Now we need to verify our database access credentials in the wp-config.php file.

g) Go to your home directory -> Select wp-config.php -> and Click Edit to Open the file. Verify and change if need DB_Name, DB_USER & DB_PASSWORD should be the same which we had given while creating a new user to assign to the database. Scroll down the file and verify that table prefix are the same as in the database tables.

h) By following this process we have successfully migrated our website to new hosting with the same domain. If we uploading website backup to the new domain then we need to update the siteurl, home url in one database table called Option. Path: Go to cPanel-> Search phpMyAdmin -> open Database -> search table Option and modify your details.

i) Now we are done with all steps. Let’s try to access our website. Excellent we are able to access the website and all URLs.

Thanks for reading our Technical Knowledgebase.

Thank You,
Garvit K.
HOST2BOOST (The Real Hosting Choice)


Was this post helpful?

One Reply to “How to Migrate WordPress Website to Another Hosting?”

Leave a Reply

Your email address will not be published. Required fields are marked *