How to Move WordPress from Localhost to Live Server: Beginners Guide
So, you are all done with your WordPress website and want to make it live? But how do you make your website live? Here we are going to discuss in detail the quick and easy steps to move WordPress from localhost to live server. Let’s begin!
How to move WordPress from localhost to live server?
Most of the developers create websites on localhost, which is a local server that can be hosted on a local system or computer. Developing websites on a local host offers great benefits over a live server. However, once you build a website locally, you need to upload it on the live server, which can be quite a task, if you are not familiar with the steps.
Once you are done with the design of the website, the next step is to make it live. So, if you are a beginner in website development, migrating a WordPress website from localhost to a live server will require learning and skills. If you do it manually, the entire process takes time and requires skills.
Although you may be tempted to use a plugin, however, if you have a huge website it is common to experience issues between the local and live servers. So that is why it is also important to learn the manual method also.
In this post, we are going to discuss in detail how to move WordPress from a local host to a live server. We are going to discuss both manual and plugin methods. So it is up to you to choose the best option that suits you.
Prerequisite for WordPress Website:
- You need to have a WordPress website running on your local computer. So you will have to set up WordPress locally. You can check out our guide to installing XAMP and WordPress locally.
- But first thing first, you require a hosting plan to upload your WordPress website. If you haven’t chosen a hosting provider yet, then I highly recommend Bluehost. It provides suitable hosting plans for all at affordable pricing, along with a 99.9 percent uptime guarantee. It is one of the most trusted and oldest hosting companies out there. You can also check out the best WordPress hosting providers and choose the best fit for your website.
- SFTP (Secure File Transfer Protocol) details for your hosting account. Mostly, these are the same as you login details for the hosting account.
- Assuming you have a domain name, and web hosting, let’s see a step-by-step guide to make your site live on the server.
Methods to Move WordPress from Localhost to live Server and Publish Website
First of all, you need to create and test your WordPress site on a local host. For this, you need to install WordPress and XAMPP locally. You can also try “Local WP” which a newer WP local development tool to create your website locally. Once you are done with the design, and your website performance is good enough, it is about time you move it to the live server.
So, you have two methods to move your website from localhost to a live server:
- Manual method
- Using Plugins
Assuming, you have a domain name and web hosting, let’s see the step by step procedure to make your site live on the server:
1. Manual Method: How to move WordPress site from localhost to live Server
To move your WordPress site manually, you will first export it via phpMyAdmin.
Step 1: Export Local WordPress Database
For exporting your database, simply navigate to http://localhost/phpmyadmin/ and select your WordPress database. Next, click Export button from the top menu bar.
You will find two options here – Quick and Custom. Custom will give you more options to export your database.
If you are choosing Custom, make sure that all the tables get selected. Choose the gzipped form of compression for the output file. The gzipped compression is mainly used for large database files.
Under Format-specific options, select structure, and data. Also, check the following boxes:
- Add DROP TABLE / VIEW / PROCEDURE / FUNCTION statement
- IF NOT EXISTS
- Enclose table and column names with backquotes
Once done, click Go button to download the database file.
Step 2: Upload WordPress Files to Live Site
To move your WordPress files, open your FTP client. For demonstration purpose, we are using FileZilla FTP client here. First, connect to your web hosting account and browse the root directory of your live server. Then, Upload all the files in the right destination directory. For example, if you want to host the site on mysite.com, then upload all files in public_html directory. You will get an inbuilt File Transfer feature on your CPanel if you are using a good Web Hosting like Bluehost or SiteGround.
Step 3: Create New Database on Live Site
Your WordPress files will take a while to upload, meanwhile import the database saved to your hard drive in the first step. Hosting providers offer different ways to do so. Some do it through phpMyAdmin & some via cPanel. The cPanel is more popular so we are creating a database via cPanel here.
First of all, log in to your cPanel dashboard. Click the MySQL Databases icon in the databases section. Top Hosting providers i.e. Bluehost generally provide a direct link to the CPanel login in the first signup email, otherwise you can also find it from your hosting admin.
From the next screen, you will create a database by specifying its name.
After creating a database, navigate to the MySQL Users section. Here, create or add an existing user to the database.
cPanel will take you to set MySQL privileges for that user. Now, grant all privileges to the user by checking every box. Then, click Make Changes button.
Step 4: Import Local Database on Live Site
Go to your cPanel dashboard to import your WordPress database. Navigate to database section and select phpMyAdmin. Now, you can see your newly created database in phpMyAdmin. Go to Import page by clicking the Import Tab on the top bar menu. Next, click on Browse button to choose the database file created in step 1.
Then, press Go to import your WordPress database.
Step 5: Redirect the Site URLs
Now, you have to replace all the links in the database contained inside are still pointing to the old site location. In phpMyAdmin, look for the wp_options table in your database. Click Browse button or the link in the sidebar to open the page with a list of fields within the wp_options table. Under the options_name file, you need to look for siteURL. Click Edit option that will open an edit field window.
In the input box for option_value, you can see the URL of your local install like http://localhost/test. Replace it with your new site URL in this field, for example, http://www.templatetoaster.com.
Save the changes by clicking the Go button.
Next, you will repeat the same steps for the option name: home. So, simply find the home tab in the wp_options page. Update the home URL to be your site URL.
Step 6: Set Up Your Live Site
Once you import the database, it’s time to configure wp-config.php. Connect to your website using an FTP client, find wp-config.php file and right click to View/Edit. Look for the information:
Provide the database name, user, and password you created in the earlier step. After that, save the wp-config.php file and upload it back to your server. Your website should be live now so you can log in. Move to Settings » General and without changing anything, Click Save Changes button. It will ensure that the site URL is corrected wherever needed.
Go to Settings → Permalinks, choose your preferred URL structure and save it to ensure all post links are working well.
Step 7: Fix Images and Broken Links
Whenever you move from local server to a live site, it is obvious to get some broken links and missing images. You can either use the SQL queries or use the Velvet Blues WordPress plugin to fix these.
If you choose SQL, go to phpMyAdmin. Click on your database and press SQL from the top menu. Write this query:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.mylivesite.com/');
Replace the local site and live site URLs with your own.
That is it !! You have successfully migrated your site to the live server manually.
2. Make Website Live Using Plugins
The second most convenient and comparatively easier way to migrate your site is by using WordPress plugins. There are many plugins available in WordPress repository for the same. But two most reliable and popular plugins are All-In-One WP Migration and Duplicator. Let’s see the step by step procedure to transfer a site using both one by one:
It is a popular plugin with more than 900,000 active installs and a rating of 4.8. It exports your WordPress website including the database, media files, plugins, and themes. You need no technical knowledge for this. The steps you will follow to migrate your site to a live server are as:
Step 1: Install and Activate the plugin.
Step 2: After activating it, you can see an option named All-in-One WP Migration in the left pane of your WordPress Dashboard. Click on Export and it will open an Export Site window as shown below.
Here, it will ask you about the format in which you want to Export your localhost site. Suppose you select File. then, it will prompt you to Download Localhost with information of file size as shown below.
Click Download Localhost.
Step 3: Now, log into cPanel. Install WordPress on the destination server and then, All-In-One WP Migration plugin from the dashboard. Activate it. Once activated, navigate to left pane of the dashboard and Click Import option under All-In-One WP Migration section.
Here, select the same format to Import the local site as selected in Step 2.
Step 4: Select the database file you created in step 2 from the browse button as shown below.
Step 5: It will prompt you before Importing the localhost file as shown below. If you have taken the backup of your site and sure to move it, click Proceed.
That’s it!! Your site is live now. It is really simple to move your site from localhost to server with All-In-One WP Migration.
It is another one if the best migration plugins with 1+ million active installs and a 4.9-star rating. Let’s see how to use it to move your WordPress site from localhost to a web server:
Step 1: Download and Install Duplicator on your localhost site from the WordPress plugin repository.
Once installed, activate it.
Step 2: Now, you can see a Duplicator section in the left pane of your WordPress dashboard. When you click on Packages, it will display No Packages Found. As you have just installed the plugin and no packages are available here.
A package will include an archive and an installer file that automates the process of setting up your site on another server.
So, click “Create New” to create a package.
Step 3: The next screen will prompt to specify the name of your package and making a few notes. It’s not necessary to name your package, though you can give it a memorable title. Also, add a few notes if you want to.
There are also some optional Archive and Installer settings. The Archive settings allow you to filter your database. Whereas the Installer options are used to pre-fill the Installer screen to prepare setup at install time for future. It will speed up your overall install process.
Then, click “Next”.
Step 4: Duplicator will now run a system scan to ensure the smooth processing of package building. It will also determine the potential issues. More “Warn” checks indicates that you will run into issues during the build and install phases.
Now, press Build to create your package. It will start backing up your site.
Step 5: The plugin will produce two files after throwing a package completion message. These files are – an archive of your site as a .ZIP file and an installer file as a .PHP file. Download both files.
Step 6: Now, you need to install and unpack your packaged site. For that, you will copy the downloaded files in the earlier step to my live site’s directory. You can use an FTP application like FileZilla for this.
Step 7: Login to your site via FTP and navigate to your public_html folder. Copy the archive and installer files here from your desktop. It can take a little longer.
Step 8: Next, you will install the archived site on the live server. For that, access the installer by adding /installer.php to the domain. It will validate first, all the files copied.
Step 9: Then, the installer interface will prompt you to add your MySQL details. In case, you are only replacing an existing site, you will enter the existing database details. If you’re creating a new site, click “Create New”. Then, enter fresh database details. Make sure that you get a “Success” message for both the “Server Connected” and “Database Found” tests before moving on.
Step 10:. Next, it will Update Data for your live site.
Step 11: Your site is ready and you can test it by opening the front-end of your live site to check that everything is working fine.
That’s it !!
Which way you use to Move WordPress from Localhost to Live Server?
As you have seen, it is not that tough to move a WordPress site from localhost to a live server. It takes only a few steps to do all manually. Though using plugins, it is quite simpler. But, you should have enough knowledge to how to move WordPress from localhost to live server manually. When you are bearing the same pain to design a WordPress website, test it, and then to make it live, it should look beautiful and competitive enough. But, you need not struggle more for making an awesome site as you can rely on our WordPress theme Builder. It will create amazing WordPress website themes for your site with all the latest web design functionalities. You don’t have to write a single line of code, just drag and drop to get your site ready within no time. Check out our best WordPress hosting providers, WordPress themes. So, step forward to a smooth journey of website development !!
Related reading: WordPress 101 tutorial
Build a Stunning Website in Minutes with TemplateToaster Website BuilderCreate Your Own Website Now