How to Move WordPress from Localhost to Live Server: Beginners Guide
Do you think it’s the right time to introduce your site to the world? If you checked your local site thoroughly, you can make it live unreluctantly. As here you will get all you need, and how to move WordPress from localhost to live server. Let’s start!
How to move WordPress from localhost to live server?
It’s really good to build a website locally for the speedy development. Even, it saves you from unnecessary headaches of breaking your site while troubleshooting. You can safely test your site for changes and make your workflow more efficient. Once you are satisfied with the design of the website, you can transfer it to the live server. It is quite simple though sounds tough. Here I will give you all the details to “How to move WordPress from localhost to live server”.
First things first. You need a hosting plan to upload your WordPress website, did you sign up with a hosting provider? I will recommend Bluehost if you are searching for a perfect hosting company that offer budget plans with 99.9 percent uptime guarantee. It is one of the oldest hosting company in the world.
Get Bluehost Hosting
Methods to Move WordPress from Localhost to live Server and Publish Website
First of all, you will design and test your WordPress website on localhost. For that, you need to install WordPress & XAMPP. For details about setting up a local environment, you can refer our article on how to install WordPress and XAMPP locally. Once you are sure about the performance of your website, you can move it to the server. You may read about best WordPress hosting providers. You have two main methods to migrate your site from localhost to 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.
You can also Find and replace all instances via a plugin like Velvet Blues. Refer to this detailed tutorial on how to change Mass URLs for a website.
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:
All-In-One WP Migration plugin
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.
Duplicator WordPress plugin
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
How to check WordPress version
How to find WordPress login url
How to change WordPress language
How to create WordPress custom login page
How to create WordPress theme from scratch
Build a Stunning Website in Minutes with TemplateToaster Website BuilderCreate Your Own Website Now
Very nice and useful tips. Keep it up.
What will happen with paid plugins etc? Are they automatically transferred to the live site? If so, can i still use them in my local development environment?
if your localhost on bitnami for this article for you
Hello I get stuck during step 2. If you can I would appreciate if you could walk me through how to manage this step. So I get stuck when I should upload my files. My filezilla does not display my “wordpress files” as it does for you in the picture that you have in step 2. And I can not manage to search and find my wordpress files. My first initial thoughts was that the file that you refer on under step two is the file that I created under step 1? But I can not manage to locate this file through filezilla. Thank you for reading this. //Hannes
Nice Article, It’s Working perfectly.
Thanks for this. I had success using the manual process (which really is not too difficult). The key step is to change the URL in the wp_options table, then it all works fine! Both the plugins failed for me for different reasons. The all-in-one plugin just went to 100% and did not import. The other one I found too complicated. Better to do it manually then you learn a lot about how wordpress is structured.
Does plugins like All in one WP migration fix links or do I have to do it manually?
very good content, but what if I don’t have a ftp client?
I am really thankful to the one who wrote this article. This article supported my a lot
Hello, thank you this was a huge help for me. The step by step descriptions were spot on! This was definitely easy doing the FTP way…I will do that from now on! Side note: All-in-one-migration sounds tempting, but let me save some people who may be new to it a headache…It does not work 100%. It may not like some of the plugins you may have added in that export file and it will top out at random percentages when importing…and this is all after you have to use a plugin or go behind the scenes to increase your upload limit (which isn’t highly recommended). Food for thought….anyway thank you for this, it got the job done!
Very Impressive post. This is really an appreciable post. Must have taken a long time to put this together.
Can i increase the maximum upload size of a file in the live server?
This is a great help. Thanks for sharing the post.
What are some other Migration plugins except All in One and Duplicator?
Migrate Guru : Migrate and Clone is a free WordPress plugin with more that 30,000 installations. Totally recommend it.
Thanks for mentioning. This plugin looks good,
Which localhost server is best Xampp or Wamp, according to you?
I think you should go with Xampp, it is more popular and leading one.
Xampp is the most popular and reliable local host server. It is very easy to install and implement it.
Very insightful post! Thanks for putting this together.
Thanks for sharing this post! Helped a lot.
Looking for a depth Xampp Tutorial. Please suggest any
Hello there, Very good post.
What is the difference between xampp and wamp?
Very clearly explained, thank you.
Is there any other Localhost server except for xampp?
Yes, there are, wamp is one of the best localhost server
Thank you, I followed the first method (manual), and it worked right away!
Thanks a lot for these tips Deepak. It worked really well for me!!!
I was a bit confused in step 3 but everything is clear after reading this article, thanks for your help.
Thanks for posting this wonderful article, every step has mentioned very clearly. It really worth for us.
I have used both method manual as well as plugin both seem easy even manual is not that much typical so we can learn easily.
You have the best range of good article which is really helpful for us and guide us for making good website as well as make it life,thanks for your support.
Thanks to support us for providing information about servers as well as step to make our website live.
If we press refresh database button and also didn’t get any success message then we need to repeat the same process.
Which local host server is best to use?