How to Migrate WordPress from Localhost to Live Server: A Complete Guide
Developing your WordPress website locally allows you to build and test your site in a controlled environment before going live. However, once your website is ready to be accessible to users, it’s time to move it from your localhost to a live server. This process may seem technical, but with the right guidance, you can transition smoothly and ensure your site functions perfectly on the internet.
In this guide, we’ll walk you through how to move WordPress from localhost to live server step by step. Whether you are using a local development tool or simply working on your WordPress site offline, our instructions will make it easy for you to upload your site to a hosting server. Along the way, we will also highlight some useful tools, such as a WordPress Theme Builder to customize your site’s appearance, and resources like How to Create a WordPress Theme to help you set up and manage your site effectively.
How to Move WordPress from Localhost to Live Server: Steps
Step 1: Export Local WordPress Database
Step 2: Upload WordPress Files to Live Site
Step 3: Create New Database on Live Site
Step 4: Import Local Database on Live Site
Step 5: Redirect the Site URLs
Step 6: Set Up Your Live Site
Step 7: Fix Images and Broken Links
How to move WordPress from localhost Prerequisite:
First of all, you need to test your local WordPress site on you XAMPP. Once you are satisfied with the design, and your website performance is good enough, it is the time you move your website to the live server.
- Your WordPress website running on your local computer. You can check out our guide to installing XAMP and WordPress locally.
- Make sure you online WordPress website is up and running. If not you require a domain name and a hosting plan to upload your WordPress website. You can 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. All good hosting provider these days offer free SFTP inbuilt into their panel.
Methods to Move WordPress from Localhost to live Server and Publish Website
In this article I will cover two reliable methods to upload your WordPress to Live Server. The first is the manual method, where you’ll manually export your database, upload files via FTP, and configure your site on the server. This approach gives you full control over the process. The second method is using plugins, which automate much of the work and make the process faster and easier, especially for beginners. Both methods are effective, and I’ll walk you through each step so you can choose the one that best fits your needs.
So, you have two methods to move your website from localhost to a live server:
- Manual method
- Using Plugins
These steps apply to any environment, including XAMPP, WampServer, MAMP, LAMP, Vagrant, Docker, Laragon, and Studio.
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
- AUTO_INCREMENT
- 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.
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. Good Hosting providers 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.yourwebsite.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.
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:
define(‘DB_NAME’, ‘your_database_name’);
define(‘DB_USER’, ‘your_database_user’);
define(‘DB_PASSWORD’, ‘your_database_password’);
define(‘DB_HOST’, ‘localhost’);
Update the database name, user name, and password you created in the earlier step. After that, save the wp-config.php file. 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.
For a smooth start with your live WordPress site, check out our collection of free WordPress themes to give your site a professional look in no time.
Option2: Move WordPress Website to Live Server 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
All in one WP Migration is a very popular plugin with a good rating. 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 All-In-One WP Migration plugin from the dashboard of your live website. 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
Duplicator is another one if the best migration plugins with best user 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.
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
Build a Stunning Website in Minutes with TemplateToaster Website Builder
Create 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?
You should explain it with Local WP
In past I’ve tried Elementor but that adds lots of bloat.
I always prefer All-In-One WP Migration plugin to Migrate WordPress from XAMPP to Live Server.