Cart 0
No products in the cart.

Moving a WordPress Blog to a New Web Host using cpanel

Moving a WordPress Blog to a New Web Host using cpanel

 

The process of moving a WordPress website to a new host can be frustrating if done by a basic WordPress user.

Its complexity can be due to the size of database as well as the number of files in the default host.

Here at Fixwebnode, we shall look into how to move WordPress to a new host.

 

Steps to move a WordPress website from one host to another

1. Take a backup copy of the default website

To begin, you need to take a full backup of the default website to enable you safeguard the files in case something goes wrong.

You can either use FTP programs like FileZilla or the File Manager in cPanel for creating a backup copy of the site.

For cPanel's File Manager, create a backup of the website files by doing the following:

  • Go to the cPanel dashboard by logging into your webhost area.
  • Then, click the "File Manager" tool in the Files section in cPanel.
  • Now, locate the "public_html" directory.
  • Next, Click the "Select All" function from the toolbar.
  • Next, Click the "Compress" function in the top right corner. This will create a ZIP backup copy of the entire website using File Manager.
  • You can click the "Zip Archive" option on the top when the compress window opens.
  • Next, Scroll down to the bottom of the Compress window and Change the name of the Zip file to "newwordpressbackup". Note that this is just a given name. In this case you can use any name you like as this will be the file you'll need to move your website.
  • Next, Click the "Compress File(s)" button to create the Zip file. In  a few minutes time, you'll see a results screen displaying what files and folders were compressed. 
  • Now, Click the "Close" button to exit the compressor.
  • Finally, Select the newwordpressbackup.zip file and click "download". Save this file somewhere you can easily find it. 

 

2. Export the Website Database

To export the database of the WordPress website you want to migrate, simply follow the below steps:

  • Click on "phpMyAdmin" located in the Databases section from cPanel.
  • Next,  locate in the left panel the database associated with the website and click it. If you don't know your database, you can find it in the wp-config.php file of your website. This file can be found via the File Manager. So once found, you can edit it to find the database.
  • After you access the database you want in phpMyAdmin, click the "Export" option in the toolbar.
  • Leave the default options as they are and click the "Go" button to begin exporting the database. Do not forget to save it to a location you can easily remember.

 

3. Create a new database on the new Host

Now to create a create a database on the new website server, follow the steps below:

  • On the new Website host's cPanel, click on the "MySQL Database Wizard" under the "Databases" Section.
  • Now, follow the instructions to create a new database for your website. Take note of the database name, username and password you are going to use. This is important as you won't be able to access your website's content without it.
  • Next, click the "Create User" button to continue.
  • In the next screen, ensure that you check the box for "All Privileges".
  • Next, Scroll to the bottom of the page and click "Next Step" when you're ready to build the database.
  • Now, you can access your database through phpMyAdmin.
  • In phpMyAdmin, click on the new database, and click the "Import" option.
  • Now, Choose the SQL file you saved before which has a .sql extension.
  • Next, Click the "Go" button to upload your database.

 

4. Upload website files to new host

To upload website files in the new host via cPanel, follow the below steps:

  • From the File manager, go to the website's directory by clicking "public_html".
  • Next, Click the "Upload" option from the toolbar.
  • Now, select the "newwordpressbackup.zip" file to upload it to the new server.
  • Next, Go back to your website's directory, and you’ll see your .zip file uploaded. Select the file and click "Extract".
  • Finally, Click the "Extract File(s)" button to unpack your website.

 

5. Configure the wp-config.php File

To enable your newly migrated website to function, you need to setup the wp-config.php File.

So follow the steps below to configure the wp-config.php File:

  • Start by selecting the wp-config.php file and click, "Edit".
  • In this file, you'll replace the old database information with the new name, user and password you created.
  • Next, click the "Save Changes" button on the top right.

 

How to test the Migrated WordPress blog ?

You can simply access your website using the https://www.fixwebnode.com/wp-admin.php address (replace "fixwebnode.com" with your domain).

 

[Need help in fixing WordPress Migration issues ? We can help you. ]

 



CONCLUSION

 

This article covers the best way to move a WordPress site to a new host without any issues.

 

Steps to migrate a WordPress Blog to another host involves the below process:

  • Sign up to a new host – Choose your new provider based on what's important to you.
  • Back up your website's files – Use a plugin or an FTP protocol to save your files.
  • Export your database from your existing host – Begin the transferring process from the control panel of your old host.
  • Create a MySQL database on your new host – Create a new home for your old files.
  • Edit the wp-config.php file on your website's files – Make sure the database information is up-to-date.
  • Import your saved database into your new host – Upload your database.
  • Upload your website's files to your new host – Upload your files from your local computer.
  • Update your DNS settings – Make sure your domain's settings point to the new server IP address.

 

How to move WordPress website from localhost to a live server ?

Once you take a Backup of the local site, follow the steps given below:

1. Log in to your web server using your SFTP client of choice. 

 

2. Navigate to your website files on your local computer. If you can see a wp-config.php file alongside directories like wp-content, then you’re in the right place.

 

3. Go to the public directory on your web server (right pane). This is typically a folder called 'public_html' or 'www'. This does vary from host to host, so check with them if you're unsure. If you’re hosting your site in a subfolder, you'll want to navigate to that subfolder.

 

4. Select all of the local files from the left pane and drag them to your web server in the right pane.

 

5. Import the data from your local database to your live database.

To do this, you first need to Export the database from localhost:

In phpMyAdmin:

  • Select your database.
  • Click the 'Export' tab.
  • Select 'Quick' as the export method, choose 'SQL' as the file type, and click 'Go'.
  •  

6. This will download a .sql file to your computer. Take a note of where this is saved, as you'll need to import this on your web server.

 

7. Create a database on your live server. To do this:

  • In your hosting control panel, go to the 'Databases' section and click 'MySQL databases'.
  • Create a new database.
  • Create a database user. Scroll down to the 'MySQL Users' section and create a new user.
  • Add the database to the user and assign permissions. To do this, scroll down to the 'Add user to database' section, select the user and database that you just created, and click 'Add'.
  • Assign all privileges to the user account and click 'Make Changes'.

8. Edit your wp-config.php file and use the newly created database information.

 

9. Import the data that you exported earlier via phpMyAdmin.

 

10. Change the site URLs in your database. You'll need to ensure the database contains the new site URL, and not that of your localhost. Do the following:

  • Open phpMyAdmin and select your database.
  • Click on your WordPress options table. Tables usually appear on the left.
  • Once opened, you should see the first two options. Under the 'option_name' column, you'll see 'siteurl' and 'home'.
  • Double click on the option value under the 'option_values' column and change both of these to your new URL. Make sure you don't include a forward slash (/) at the end.
  • Open your browser and type in your live site's url with /wp-admin/ at the end (e.g. https://yourwebsite.com/wp-admin/). From here, you should be able to login to your WordPress dashboard. 

 

11. Flush your permalinks. To do this:

  • Go to your WordPress dashboard and log in.
  • Go to Settings → Permalinks.
  • Click 'Save Changes'.

 

13. Search and replace localhost URLs in your database.

To do this:

 


icon

Sign up to Newsletter

...and receive a free support ticket.