In order to make the tasks easier, WordPress Development on a local server is a smart idea. Developing a WordPress website on a local server can speed up the process of development. But, when once the website is developed on a local server, it is necessary to move the website live and make it known to the world.
This article will offer a step by step guide for moving your WordPress website from local to live server.
- First of all, there are certain things that you need to have, such as you must have WordPress website that is running on a local server with full access on it.
- Another thing required is a domain name and web hosting.
- An FTP program.
Now let us begin with migrating the WordPress website from local to live host.
Steps to Move WordPress from Local to Live Website
Step 1: Export Local Database
This might be the first thing you need to do for the migration of the WordPress website from local to live. It can be done through phpMyAdmin. Simply click on Export from the top menu bar in the WordPress database of the phpMyAdmin.
For the Export method, you can choose custom or quick to make your export process easier. With custom, you will be provided with more options to export the database. Similarly, with quick, the export process will be made faster and easier than the regular.
Choosing Quick is mainly recommended in order to download the database.
Step 2: Upload the WordPress Files to Live Site
Moving further, it will be needed to move all the site files to the live site. In order to begin with, you need to open the FTP client and connect to the web hosting account. After connecting to your live site, you need to upload the files in the right directory. When you need your site to be hosted on the website, you should upload all the files in the public_html directory. Post this, you need to select your WordPress files and then upload it to the live server.
Step 3: Create MySQL database on the Live Site
While the FTP client uploads the WordPress files, you can import your database to the live server. Most of the hosting providers offer cPanel in order to manage the hosting account. For the entire process of creating a database using cPanel, you can log in to the cPanel dashboard and click MySQL databases icon that can be found in databases section.
Read Also: How To Fix Common WordPress Errors
Following that, create a database by entering the name for your database and click on Create Database.
Post that, add a user to the database. Now, the cPanel will let you set MySQL privileges for the user. Here, you need to grant all the privileges to the user and save the changes.
Step 4: Import the Database on Live Site
Importing the database to the live site. For this, you need to go to your cPanel dashboard, and click on the PhpMyAdmin. You will now be redirected to the database created by you, simply click on Import tab in the top menu.
Here, you will be given the option to choose the file from your system. You are supposed to select the database file saved by you earlier.
Step 5: Change the URL
Now comes the important step .i.e. To change the URL in the database. This will connect with your live WordPress website.
For this, you need to look for wp_options table in the database of PhpMyAdmin. Browse the wp_options and you will be taken to a table. In this table, go to options_name field and look for the siteurl. Now, edit the field icon that can be found at the left in the beginning of the row.
You will now find the edit field window, where in the input box, you will find the URL of the local host. Here, you need to insert the new site url and then save the changes. Now, you will find that the wp_options page is a few pages long, so you can go to home by clicking on the pagination arrows in phpMyAdmin.
Step 6: Set up the Live Site
Now, when you have the database imported and the content is uploaded, it is time to configure WordPress. This is the time when your site would be showing an error. In order to fix this error, you need to connect to your website using FTP client and edit wp-config.php file. Provide the required credentials to the database, and then save the wp-config.php file and then upload it back to the server. Post this, if you visit your website, the website must be live now.
Now, you are few steps away from the live website. Go to Settings>General. Without changing anything, simply save the changes, this will make sure that the site URL is corrected if any changes required in the same.
Step 7: Fix the Broken Links by Updating Paths
When moving WordPress from local to live, you may find some broken links and missing images. One can easily fix this errors using the SQL query. The query mentioned below, should be used to solve this problem:
UPDATE wp_posts SET post_content =
REPLACE(post_content, ‘localhost/test/’, ‘www.yourlivesite.com/’);
Post this, simply go to phpMyAdmin, click on the database and then click on the SQL from top menu. In this, write the above mentioned query.
And now, your website is good to go for any kind of live process to do. The live site will now run smoothly and will be up. Keep checking if there is any change in the website’s performance. If you notice any error, fix it as soon as possible to make the most out of your WordPress website. And still, if you face any problem, you can contact WordPress web development company for more guidance.
This article is written by Harshal Shah, Director of Elsner Technologies: WordPress Development Company.