Tech

How to Transfer WordPress Website From Local Server to Hosting Server

You built your WordPress Website locally, now you’re done. So what next?



In this article, I’ll show you how you can host your website. If you’ve been using Localhost to build your WordPress website, maybe using XAMP or any other software in your system. It’s time to let the world see your website.


Don’t worry, it’s simple. Just follow the steps below, and do it yourself. Note you must know how to build a complete website locally before you can understand these steps.

Step 1Purchase a Hosting Space and Domain Name

Step 2Export your Local WordPress Database form phpMyAdmin



To complete this step, visit http://localhost/phpmyadmin/ from your browser

Simply go to http://localhost/phpmyadmin/ and click on your WordPress database name. Then, click on the ‘Export’ tab from the top menu bar.

In the export page, look for the ‘Export method:’ option, you can choose ‘Quick’ or ‘Custom’. Custom will provide you with many options to export your database. Click ‘Go’ button below to download your database.



Step 3Upload your Website Folder to your Hosting Server

You can do this by using an FTP software like Filezilla and connect to your web hosting account or simply zip your website folder and upload it to the root folder of your hosting website folder, then extract it to the root folder.

Any method you’re using, make sure to upload the files in the right directory. That means if you want the site to be hosted on ‘mywebsite.com’, then you will have to upload all the files in your public_html directory or “mywebsite.com” directory (if it already exist) inside the public_html directory.

See also  SQL Data Types for MS SQL Server, MySQL and MS Access

Step 4Create and Export the same Database to your Hosting Server

After you’ve uploaded your WordPress website files and folders, you’ll need to connect the website to its database in the live server.

Many WordPress hosting providers offer cPanel to manage your hosting account, therefore I’ll recommend using cPanel.

In your hosting server dashboard, select cPanel, then click on the ‘MySQL Database’ icon, which can be found in the ‘Databases’ section as you scroll down.

To create a the database, simply enter the name for your database, then click ‘Create Database’ and cPanel will automatically create a new database for you.

Then enter a username and password for your new user, and click ‘Create User’. After that, you’ll need to add the user to the database you just created.

Check the ‘All Privileges’ checkbox and click on ‘Make Changes’ to save your changes.

Congratulations, you’ve successfully created a new database for your live WordPress website.

Step 5Import your Local WordPress Database to the Live WordPress Website Database

Return to your cPanel dashboard, then scroll down to the ‘Databases’ section, and click on the ‘phpMyAdmin’ icon.

Click on phpMyAdmin and a database management webpage opens. Click on the database you just created above to open it, then click on the ‘Import’ tab in the top menu. On the import page, click on the ‘Choose File’ link and select your local database file (the one you extracted earlier from your localhost).

Import the database by selecting and clicking the ‘Go’ button at the bottom of the page. Your database will be automatically imported to phpMyadmin as your website database.

Step 6Change your WordPress Website Domain Name

From the database table you just imported, look for the wp_options. If you changed your database prefix, then instead of wp_options, it might be {new_prefix}_options.

Then click on the ‘Browse’ button next to wp_options. Or click the link in the sidebar to open up the page that has a list of fields within the wp_options table. Look for the siteurl option and click on the ‘Edit’ icon.

See also  Embark on a Tech Journey with Google's Software Engineering Internship 2024

The present URL might be http://localhost/test. Simply replace that link to your new website URL in this field, Eg. https://ntells.com.

Click on the ‘Go’ button to save changes.


Do the same for the home option name (change the option_value link to your new website URL). The wp_options menu can be a few pages long. Usually, the home option will be on the second page.

Step 7Configuring your WordPress Website

Open the wp-config.php file (located at your live wordpress website root folder) to update the database name, username, and password you created earlier.

Next, you’ll need to login to your WordPress dashboard, click on Settings » General. Then, without changing anything, scroll down and click the ‘Save Changes’ link.

Also, “Save Changes” for general settings. This is to make sure that your wordpress website URL is corrected anywhere else that it needs to be. Finally, go to Settings » Permalinks, scroll down and click ‘Save Changes’ link to ensure that all post links are working fine.

To further fix images and broken links by updating paths:

Simply copy and paste the SQL query below to phpMyAdmin database by clicking on your database, and then click on ‘SQL’ from the top menu and add the query below.

UPDATE wp_posts SET post_content = REPLACE(post_content, ‘localhost/test/’, ‘www.mylivewebsite.com/’);

Make sure you change it to your own local site and new website domain URLs and click the ‘Go’ button.

Congratulations, you’ve completed the steps to migrate your website from your computer to a live hosting server.

If you have successfully hosted your website using this guide, please share your website link in the comment section, so we can see your good works.

See also  Xiaomi's Electric Car Revealed, $4k Cheaper Than Tesla Amid Competition

If you need help in completing these steps or want to learn how to build a complete WordPress website from scratch, contact a WordPress expert and Instructor now.

Tell us what you think in the comment section below and also share this content with the world.

How useful was this post?

Click on a star to rate it!

As you found this post useful,

Please share this to social media platforms

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?



Leave a Reply

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