Many people face problems in their WordPress website and think that the issue is on their website. But most of the time the problem is because of the hosting providers. In order to tackle this problem, you need to migrate WordPress website to the better host.
What is WordPress Migration?
The process of moving the website from one host to another or from one domain to another without changing the functionality of the WordPress website is known as WordPress migration. There are many reasons for the migration of the website.
Reasons to Migrate WordPress Website
Hosting server plays an important role in the website and not every hosting service provider use best elements. A weak or bad server may affect your website and its conversion rate. Here are some reasons to migrate WordPress website.
Protection of the website is not only your job but your hosting server provider’s as well. The hosting provider must provide firewalls and take all the precautionary measures to protect the website. If the hosting provider lack of providing security to your website, it is good to migrate WordPress to new hosting.
2. Customer Service
Customer service is very important if the service provider is not efficient to respond to your quires then you should migrate WordPress website to another host. The customer service is always on priority in many industries. The service provider must have to provide support for longer and better business.
3. Bandwidth Problem
The most common reason to migrate WordPress website is the bandwidth problem. You should know the bandwidth of your hosting provider upon choosing it. The growth on the website can cause a problem if you are using shared hosting. You might need to change your hosting package, and if you don’t get enough bandwidth, then it’s time to move the website to the new host.
How to Migrate WordPress Website to New Hosting Server
If you have decided to move your WordPress website to the new hosting server, then you should follow the following steps to do it.
- Backup the WordPress Website
- Export the WordPress Database
- Create the Database On Your New Hosting Server
- Edit the wp-config.php File
- Import the WordPress Database
- Upload WordPress files to the New Host
- Update the domain
Backup the WordPress Website
The first and most important step of the website migration is back up. Create the backup of your WordPress website in order to migrate WordPress website to another hosting server. Doesn’t worry if you don’t know how to do the backup you can use a plugin for backup.
- In order to create back up, log in to the website hosting server.
- Next copy all the files from the root directory including .htaccess file of your website.
- Now paste these file on your local computer.
Creating backup may take some time so no need to worry.
Export the WordPress Database
Website database is also important if you want to migrate your WordPress website. The database is like the brain of the website it contains all the data of the pages and posts of your website. The procedure of exporting database is very simple.
- First login to cPanel of the web server and then open phpMyAdmin section.
- Now select the database that referees to your WordPress installation.
- Simply click on the export button, and you may see the option to select the settings, keep it to default.
- You need to export the SQL format of the database on your computer.
If you have hosted multiple websites on the single hosting server, you can navigate through the wp-config.php file to find the suitable database for the website you want to migrate. In the wp-config.php file, you can find the exact database by searching the name.
Create the Database on Your New Hosting Server
Now you need to create the database to import your website data before installation of WordPress. You can do this by following the steps below using MySQL Databases application.
- First login to your new hosting account.
- And connect to the cPanel software.
- Now open MySQL Database and create the new database.
- Also, create the new MySQL user and make it secure using a strong password.
- Now add the new account to the database and allow all Privileges for it.
Edit the wp-config.php File
After the completing above mentioned steps, edit the wp-config.php file. In order to edit the file open the folder containing the website files. Now locate the wp-config.php file in that folder.
Create a copy of the wp.config.php file and save it to another location on the computer. Now with the help of the text editor open the original file and make the following changes.
- Locate and Change the Name of the Database.
Find this line: define (‘DB_NAME’,’db_name’)
In this line the name of the MySQL database is set as the previous web host. Change the name with the new database that you have created.
- Locate and Change the Username of the Database.
Find the line: define (‘DB_USER’,’db_user’)
In this line, change the username of the previous host with the new one.
- Locate and Change the User Password of the Database.
Now find the line: define (‘DB_PASSWORD’,’db_pass’)
Now change the line db_pass with the secure password that you have created for the MySQL user.
Import the WordPress Database
When the new database has been created and changed accordingly, it’s time to import the database. Follow the following steps to import the database.
- From cPanel launch the phpMyAdmin on the new hosting server.
- Now, select the new database from the shown list.
- Then click on the import button when the database is opened.
- Click on Choose File and select MySQL file of your website that you have saved.
- In the checkbox section uncheck the Partial Import.
- Make sure that the format in SQL and then click on the Go button.
Upload WordPress Files to the New Host
After creating a new database and reconfiguring the wp-config.php file start uploading WordPress files to the new host.
- Connect to the new web host using FTP.
- Now browse the folder where you want to keep your website.
- Upload files to the public_html folder if this is the only WordPress website that you are going to install on the new server.
Note: Do not delete the file that you saved in your computer even if the upload process is done. The file is required for the finalization of the website.
Update the Domain
As you have made copies of the database and moved the files to the new server, your domain is still directing to your previous host. You can change it without moving WordPress site to a new domain.
Migrating WordPress website may seem a bit difficult to do, but if you follow the steps mentioned above, then it will be easy for you. If you still find it difficult to migrate WordPress website, then don’t hesitate to contact the experts.