You might be well aware of the word “Localhost” if not, then let me tell you that localhost is the local server that you make on your PC or Laptop. Hosting your site on the local host is the best way to test a website. In this post, we are going to learn how to move wordpress site.
A developer always uses localhost to develop a website because there are a lot of changes and previews involved in the process of website designing.
I understand that a website is the central part of your business and thus you want to give it the best look. Many people, especially bloggers like to customize their site a lot so that their website can provide the best possible number of sales and thus a lot of editing and previewing is involved in this process. So investing money just in testing or developing your website isn’t a good idea and therefore localhost comes handy for them.
Since quick loading is another factor for ranking nowadays, people work a lot in optimizing their website for performance. They optimize the site so that it generates a lesser amount of requests, load instantly and have the minimum amount of coding.
You may want to read: Exploring the WordPress Dashboard
All these processes need a lot of testing, and so localhost is the best option.
Many people visit my blogs daily, and many of them have the same question as for how they can move WordPress site from localhost to live server?
So I thought to write a detailed post on this.
Given below is a complete guide to moving WordPress Site From Local Host To Cpanel
After you finish up the designing process of your website, the next process is to Move WordPress Site to the live server. So, let’s see how to do it.
Before you begin
You need to have few things. The first thing is to let us assume that you have a well-working WordPress website on your localhost and you have its full access.
Preparations before migrating
If you are making a completely custom website, there are many things that you have to preserve before going through the process but, since here we are dealing with WordPress, we just have fewer numbers of things that you have to consider. The preparations that you have to make before, is to make the backup of your website’s database.
Making Backup of your wordpress database
The database is the most important thing of a website and if you lose it, you lose everything. The database contains all the posts, tags, Url, and many numbers of things in a proper format. So in order to make our live site working properly, making a backup of the database is very important.
The first thing that you have to do is to make
Click on the database that you have created.
Then click on the Export button given at the menu bar.
On the next screen, choose “Quick” option and format as SQL.
Click on “Go”.
This will make the backup of the database, now just download and save it to a safe place on your local PC.
Restoring website to live server
The folder in which you have stored your website is another important part. It contains all the images, media, themes, plugins, and other codes inside. This folder also contains all the efforts that you have made in order to develop the website of your dream. If you want to learn Best Ways to Install a WordPress Theme click here.
Also check: 3 Different Ways To Install a WordPress Plugin
Uploading the content to live server
Now as we have prepared the backup of all our website data, the next work is to restore our website on the live server.
- Go ahead and open the FTP client.
- Connect the client to your live server.
If you want to host your website to example.com, then you must remember that you have to upload the content to Public_html directory.
Now, select all your localhost WordPress files (inside test folder) and paste it
Making new database in Cpanel
While the process of uploading the content goes on, you can create a database for your website.
Login to your cPanel.
Click on MySQL Databases.
Click on Create Database and enter the name of the new database.
As it’s done, make a new user for your database by clicking on create user.
As the process completes, you will be redirected to the permissions page. Here you have to put
Click on import button in MySQL.
Click on Choose File and then add your computers database file to it and continue
Now you have to change the URL of your website in the database of the live server.
In PhpMyAdmin, look for the column named as wp-options
Click on browse button given next to wp-options
Now you will see site URL under Option_name and in front of that; you will see Edit
Click on it, and you will get a field filled with http://localhost/test
Just change it to http://www.yourdomain.com
Save by clicking on “Go” button.
Now find the “home” tab on the same page and as you find it
Just change home URL to your site URL.
live Wordpress site
Now as we have restored everything including the WordPress content, now it is the time to set up our live website.
When you try to open your website you will see that you are getting an error as “Error Establishing Database Connection.” So to fix this, follow the steps
Connect your FTP to live server
Get access to
Now open the wp-config.php file and change the database name, username, and password
Save it and upload it back to the same location.
Now open the URL http://yoursite.com/wp-admin and login to your WordPress dashboard
Go to settings and change the permalink structure same as your localhost
It is done.
Just check, you did it.
Now, as the migration process is completed, go to the complete website once so that you will come to know about the errors. Also, ask your visitors to point out the errors with your website because it’s impossible for you to go through each and everything alone.
This way, you have copied the WordPress site from local server to live.
If you have faced any trouble while copying your website from your local server to your live server, please do let us know in the comments below.
You have your website in your live server now.
Check out some of the best wordpress themes we reviewed which can help you make your website more beautiful: