Many WordPress users prefer to work on their websites using a local server on their computer before transferring it to a live hosting server.
It allows you to work on your website privately before making those changes available online.
Eventually, you’ll need to move it to a live server to make it available for online visitors.
In this article, we will show you step-by-step instructions on how to move WordPress from a local server to a live site.
![How to move WordPress from local server to live site (2 methods) How to move WordPress from local server to live site (2 methods)](https://www.wpbeginner.com/wp-content/uploads/2021/09/move-WordPress-site-from-local-server-to-live-site-og.png)
Why Move WordPress From a Local Server to a Live Site?
Building your WordPress blog on a local server is a safe way to test changes on your website without affecting visitors.
When you have finished perfecting your website, the next step is to move from your local server to a live site.
Let’s show you two ways to move your site from a local server to a live site.
The first method uses a WordPress migration plugin and is recommended for beginners.
In the second method, we will show you how to manually move WordPress from a local server to a live site.
You can choose the method that works best for you:
Before You Migrate Your WordPress Site
To migrate WordPress from a local server to a live server, you need to have a few things in place.
First, we are assuming that you have a WordPress site running on a local server (also called localhost) on your computer and you have full access to it.
Next, you’ll need to have a domain name and web hosting.
To make your decision easier, we recommend using Bluehost. They are an officially recommended WordPress hosting company, and they are giving WPBeginner users an exclusive discount + free domain and SSL.
Basically, you can get started for as little as $1.99 per month.
If you want a great Bluehost alternative, you can look at Hostinger. They are also offering an exclusive discount to WPBeginner users with a free domain name.
If you can afford to pay a little more, then check out SiteGround. They also have a special deal for WPBeginner readers.
If you need help setting up your website, then follow our step-by-step guide on how to make a website.
Finally, you will need an FTP program and know how to use FTP to upload your local server site to the live site.
Ready? Let’s begin migrating your WordPress site.
Video Tutorial
If you’d prefer written instructions, then just keep reading.
Method 1: Transfer WordPress From The Local Server to Live Site Using a Migration Plugin (Recommended)
This method is easier and recommended for beginners. We will be using a WordPress migration plugin to move WordPress from localhost to a live site.
Step 1: Install and Set Up the Duplicator Plugin
First, you need to install and activate the Duplicator plugin on your local site. For more details, see our step-by-step guide on how to install a WordPress plugin.
Pro Tip: There is also a pro version of Duplicator that offers secure backups, cloud storage, easy site restore, and more.
Upon activation, you need to go to the Duplicator » Packages page and click on the ‘Create New’ button.
![Create new package for migration Create new package for migration](https://www.wpbeginner.com/wp-content/uploads/2019/01/create-new-package.png)
This brings you to a screen where you can give your backup a name.
Then, click the ‘Next’ button.
![Name backup package Name backup package](https://www.wpbeginner.com/wp-content/uploads/2019/01/name-backup-duplicator.png)
Duplicator will now run some tests to see if everything is in order.
If all items are marked ‘Good’, then click on the ‘Build’ button.
![Build package Build package](https://www.wpbeginner.com/wp-content/uploads/2019/01/build-package.png)
This process may take a few minutes, depending on the size of your website. You need to leave this tab open until the process is complete.
Once finished, you’ll see download options for ‘Installer’ and ‘Archive’ packages. You need to click on the ‘One-Click Download’ link to download both files to your computer.
![Download package files Download package files](https://www.wpbeginner.com/wp-content/uploads/2019/01/download-package-files.png)
The ‘Archive’ file is a complete copy of your WordPress site. It includes all WordPress core files as well as your images, uploads, themes, plugins, and a backup of your WordPress database.
The ‘Installer’ file is a script that will automate the entire migration process by unpacking the archive file containing your website.
Step 2: Create a Database for Your Live WordPress Website
Before you can run the installer or upload the WordPress website from localhost to your hosting server, you need to create a MySQL database for your new live website.
If you have already created a MySQL database, then you can skip this step.
To create a database, you need to visit your hosting account’s cPanel dashboard. Then, locate the ‘Databases’ section and click on the ‘MySQL Database Wizard’ icon.
![MySQL Database Wizard MySQL Database Wizard](https://www.wpbeginner.com/wp-content/uploads/2019/01/mysqldatabasewizard.png)
On the next screen, there’s a field to create a new database.
Simply provide a name for your database and click on the ‘Create Database’ button.
![Name new database Name new database](https://www.wpbeginner.com/wp-content/uploads/2021/09/name-new-database.png)
cPanel will now create a new database for you.
After that, you need to enter a username and password for your new user and then click the ‘Create User’ button.
![Create new database user Create new database user](https://www.wpbeginner.com/wp-content/uploads/2021/09/create-new-database-user.png)
Next, you need to add the user you just created to the database.
First, click the ‘All Privileges’ checkbox.
![Check all privileges Check all privileges](https://www.wpbeginner.com/wp-content/uploads/2021/09/check-all-privileges.png)
Then, scroll down and click the ‘Make Changes’ button to save your changes.
Your database is now ready to be used with your WordPress site. Make sure to note down the database name, username, and password. You’ll need this information in the next step.
Step 3: Upload Files from Local Server to Live WordPress Website
Now, you need to upload the archive and installer files from your local site to your hosting account.
First, connect to your live site using an FTP client. Once connected, make sure that the root directory of your website is completely empty.
Normally, the root directory is the /home/public_html/
folder.
Some WordPress hosting companies automatically install WordPress when you sign up. If you have WordPress files there, then you need to delete them.
After that, you can upload the archive.zip and installer.php files from Duplicator to your empty root directory.
![Upload archive and installer files Upload archive and installer files](https://www.wpbeginner.com/wp-content/uploads/2021/09/upload-archive-installer.png)
Step 4: Running the Migration Script
After you have uploaded the migration files, you need to visit the following URL in your browser:
http://example.com/installer.php
Don’t forget to replace ‘example.com’ with your own domain name.
This will launch the Duplicator migration wizard.
The installer will run a few tests and will initialize the script.
![Duplicator migration wizard step 1 Duplicator migration wizard step 1](https://www.wpbeginner.com/wp-content/uploads/2019/01/duplicator-dbsettings.png)
Under the Setup section, you will be asked to enter your MySQL host, database name, username, and password.
Your host will likely be localhost. After that, you will enter the details of the database you created in the earlier step.
Then, click on the ‘Validate’ button to make sure the details you entered are correct.
![Validate settings Validate settings](https://www.wpbeginner.com/wp-content/uploads/2019/01/duplicator-validate.png)
After that, click on the ‘Next’ button to continue.
Duplicator will now import your WordPress database backup from the archive into your new database.
It will also update URLs pointing to the local site to your new live site.
You can now click on the ‘Admin Login’ button to enter the WordPress admin area of your live site.
![Admin login Admin login](https://www.wpbeginner.com/wp-content/uploads/2019/01/adminlogin.png)
Once you log in to your live site, Duplicator will automatically clean up the installation files.
That’s all. You have successfully moved WordPress from the local server to your live site.
Method 2: Manually Transfer WordPress From the Local Server to the Live Site
In this method, we will show you how to manually move WordPress from the local server to your live site. It will be useful if the first method doesn’t work or if you prefer to do it manually.
Step 1: Export Local WordPress Database
The first thing you need to do is export your local WordPress database. We will be using phpMyAdmin to do that.
If you are unfamiliar with it, then you might want to take a look at our guide to WordPress database management using phpMyAdmin.
Simply go to http://localhost/phpmyadmin/
and click on your WordPress database. Next, click on the ‘Export’ button from the top menu bar.
![Export from localhost Export from localhost](https://www.wpbeginner.com/wp-content/uploads/2017/01/localhost-export.png)
In the ‘Export method:’ option, you can choose ‘Quick’ or ‘Custom’. Custom will provide you with more options to export your database.
But we recommend choosing ‘Quick’ and then clicking the ‘Go’ button to download your database.
![Export WordPress database using phpMyAdmin Export WordPress database using phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2019/01/exportdb.png)
Step 2: Upload WordPress Files to Live Site
Now, we will need to move all your website files to the live site.
To get started, go ahead and open your FTP client and connect to your web hosting account.
Once you are connected to your live site, make sure you upload the files in the right directory. For example, if you want the site to be hosted on ‘yoursite.com’, then you will want to upload all the files in your public_html
directory.
Now select your local WordPress files and upload them to your live server.
![Upload WordPress files FTP Upload WordPress files FTP](https://www.wpbeginner.com/wp-content/uploads/2021/09/upload-wordpress-files-ftp.png)
Step 3: Create a MySQL Database on Your Live Site
While your FTP client is uploading your WordPress files, you can start importing your database to the live server.
Most WordPress hosting providers offer cPanel to manage your hosting account, so we will show you how to create a database using cPanel.
First, you need to log in to your cPanel dashboard and click on the ‘MySQL Database Wizard’ icon, which can be found in the ‘Databases’ section.
![Select MySQL database wizard Select MySQL database wizard](https://www.wpbeginner.com/wp-content/uploads/2021/09/select-mysql-database-wizard-1.png)
On the next screen, you can create a new database.
You need to provide a name for your database, then click ‘Create Database’.
![Name and create new database Name and create new database](https://www.wpbeginner.com/wp-content/uploads/2021/09/name-new-database-1.png)
cPanel will now automatically create a new database for you.
Next, you need to enter a username and password for your new user, and then click ‘Create User’.
![Create new database user Create new database user](https://www.wpbeginner.com/wp-content/uploads/2021/09/create-new-database-user-1.png)
After that, you need to add the user you just created to the database.
First, check the ‘All Privileges’ checkbox.
![Check all privileges checkbox Check all privileges checkbox](https://www.wpbeginner.com/wp-content/uploads/2021/09/check-all-privileges-1.png)
Then, scroll down and click ‘Make Changes’ to save your changes.
You’ve successfully created a new database for your live WordPress site.
Step 4: Import WordPress Database to Live Site
The next step in the process is to import your WordPress database.
Go to your cPanel dashboard, scroll down to the ‘Databases’ section, and click on ‘phpMyAdmin’.
![Click on phpMyAdmin Click on phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2021/09/select-phpmyadmin.png)
This will take you to phpMyAdmin, where you want to click on the database you just created above. phpMyAdmin will show your new database with no tables.
Next, click on the ‘Import’ tab in the top menu. On the import page, click on the ‘Choose File’ button and then select the database file from the local site you saved in the first step.
![Import database via phpMyAdmin Import database via phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2019/01/phpmyadminimport.png)
After that, click the ‘Go’ button at the bottom of the page. Your database will automatically be imported to phpMyadmin.
Step 5: Change the Site URL
Now, you need to change the site URL in your database so that it will connect with your live WordPress site.
In phpMyAdmin, look for the wp_options
table in your database that you just imported above.
If you changed your database prefix, then instead of wp_options
, it might be {new_prefix}_options
.
Next, click on the ‘Browse’ button next to wp_options
. Or, click the link in the sidebar to open up the page that has a list of fields within the wp_options
table.
![Browse the wp options table Browse the wp options table](https://www.wpbeginner.com/wp-content/uploads/2017/01/browse-wp-options.jpg)
Then, in the options_name
column, you need to look for the siteurl
option.
Then, click the ‘Edit’ icon.
![Edit siteurl in phpMyAdmin Edit siteurl in phpMyAdmin](https://www.wpbeginner.com/wp-content/uploads/2017/01/siteurl.png)
This brings up a window where you can edit the field.
In the input box for option_value
, you’ll see the URL of your local install, which will be something like http://localhost/test
.
You need to insert your new site URL in this field, for example: https://www.wpbeginner.com
.
Then, you can save the field by clicking the ‘Go’ button.
![edit the siteurl field edit the siteurl field](https://www.wpbeginner.com/wp-content/uploads/2017/01/edit-siteurl.jpg)
Next, you need to follow the same steps as above for the home
option name. The wp_options
menu can be a few pages long. Usually, the home
option will be on the second page.
Then, update the home
URL, so it’s the same as your live site URL.
Step 6: Set Up Your Live Site
Now that you’ve imported the database and uploaded your content, it’s time to configure WordPress.
At this time, your site should be showing an ‘Error establishing a database connection‘ error.
To fix this, connect to your website using an FTP client and open up the wp-config.php
file.
You’ll be looking for the following lines of code:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
You will need to provide the database name, username, and password you created earlier.
Next, save the wp-config.php
file and upload it back to your WordPress hosting server.
Now, when you visit your website, it should be live.
After that, you need to log in to your WordPress admin panel and go to the Settings » General. Then, without changing anything, scroll to the bottom and click the ‘Save Changes’ button.
![Save general settings Save general settings](https://www.wpbeginner.com/wp-content/uploads/2021/09/save-general-settings.png)
This will make sure that your site URL is corrected anywhere else that it needs to be.
Once you’ve done that, go to Settings » Permalinks, then scroll down and click ‘Save Changes’ to ensure that all post links are working fine.
![Save permalinks settings Save permalinks settings](https://www.wpbeginner.com/wp-content/uploads/2021/09/save-permalinks-settings.png)
Step 7: Fix Images and Broken Links by Updating Paths
Whenever you are moving a WordPress site from one domain to another or from a local server to a live site, you’ll face broken links and missing images.
A simple way to update the URLs is by using the following SQL query:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');
Simply go to phpMyAdmin, click on your database, and then click on ‘SQL’ from the top menu and add the query above.
Make sure you change it to your own local site and live site URLs and click the ‘Go’ button.
![Fixing WordPress images and broken URLs after moving to live site Fixing WordPress images and broken URLs after moving to live site](https://www.wpbeginner.com/wp-content/uploads/2017/01/run-sql.jpg)
That’s it. You have now successfully migrated WordPress from your local server to a live site.
Hopefully, your live website is up and running smoothly. If you notice any errors, then you can check out our guide to common WordPress errors for help with troubleshooting.
We hope this article helped you move WordPress from a local server to a live site. You may also want to see our guide on how to create an email newsletter the right way or see our comparison of the best GoDaddy hosting alternatives.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Jiří Vaněk says
Thanks for the SQL command. You really saved me a lot of time. My current procedure was to open the backup in a text editor and use the function to replace the overwrite URL. Only then could I upload the database dump where it belongs. This command to change the original URL to the new one is new to me and really saves me a lot of time.
WPBeginner Support says
Glad to hear it was helpful![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
mohadese esmaeeli says
Hello.Thank you for your comprehensive explanation.
I have completed all the mentioned steps. However, instead of displaying the content of my site, a page opens with the following message at the top: “Index of /my db name,” and below it, all the folders and files inside the database are listed.
WPBeginner Support says
You would want to check to ensure you have an index.php file and that your tool to have the site running locally is active.
Admin
Md Tanvir Hossain says
Thanks. As a New user. it is very helpful
WPBeginner Support says
You’re welcome, glad to hear our guide was helpful!
Admin
MARYKATHLEEN GIARROCCO says
Can I move my WordPress local host to another local host?
WPBeginner Support says
If you wanted to you certainly could!
Admin
Olajesu says
This is a lifesaver. I thanks you for your easy and understandable content.
WPBeginner Support says
Glad you found our content helpful!
Admin
Afridi Mohamed says
This guide was very straightforward and really helped me.
WPBeginner Support says
Glad our guide helped!
Admin
Ana-Maria says
This was a life saver! Very clear instructions for uploading WP manually. Thank you so much!
WPBeginner Support says
Glad our guide was helpful!
Admin
Khoa says
Thank you so much, it’s very clear.
WPBeginner Support says
Glad our guide was helpful!
Admin
Tamara says
Great, detailed guide, thank you. My site looks great from the front end but backend doesn’t really function like it does on my local server.
Do you also need to update the guid column of the wp_posts table?
WPBeginner Support says
No, you don’t need to update that column.
Admin
Yueshuya Yingjun says
It helps me a lot. Thank you very much!
WPBeginner Support says
You’re welcome, glad our guide was helpful![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
Paavanan Vellan says
Thanks a lot for this guidance! Really simplified my migration process. <3
WPBeginner Support says
Glad our guide was helpful![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
Sharad Gaur says
Once I transfer my local website to live environment, then after using live site for at least 1 month and created lot’s of post and comments, I made design changes and added new pages and categories in my local site. Now, how I can transfer my this new design to live where earlier design and live website already exist?
WPBeginner Support says
You can import your content from the live site using Tools>Export if it is only posts, pages, and comments on the live site. This would be duplicating that content and not removing it from your live site.
Admin
Kevin says
In buying a domain and web host to move my wp local site to a live serve, do I need to purchase a WordPress hosting or an ordinary web hosting???
I’m confused because some web hosting services have WordPress hosting and web hosting as two different options.
WPBeginner Support says
It would depend on the hosting provider, some you can place it on either and one is optimized for WordPress while other hosts only allow WordPress on their WordPress hosting.
Admin
Bob Cline says
Step 4. Runing The Migration Script
After you have uploaded the migration files, you need to visit the following URL in your browser:
example.com/installer.php
Don’t forget to replace example.com with your own domain name.
I do this, but the Duplicator Migration Wizard never starts. Any ideas?
WPBeginner Support says
You would want to ensure you placed the files in the correct folder on your hosting for the most common reason for that issue.
Admin
Ameer Hamza says
Hi! i want to move my local wordpress site to another local wordpress site using xampp so method will work for me or not?
WPBeginner Support says
You should be able to use this method for transferring to a different localhost as well.
Admin
Armel says
Hi dear team,
Thanks for this helpful article.
Please, if my domain has already an existing website and i wanted to update with my new website developed in localhost, how can i update my new website ?
Thanks for all
WPBeginner Support says
You would want to create a backup of the current live site, remove the live site, then follow the instructions in this guide.
Admin
Armel says
Thanks for your reply
JC says
I followed your steps for the manual process. Everything worked until i tried to update the posts in the PHPmyadmin. The urls doesn’t seem to update when i run the query.
WPBeginner Support says
You would want to ensure you replace the localhost/test and the yourlivesite.com with the correct addresses.
Admin
Montu says
I am setting up my site using manual method (method #2) and have followed till step no. 4 without any error.
However, after added my DB login details in wp-config.php file, now the site (WP set up page) is not appearing and the site keeps loading with a blank screen eternally.
I don’t know if something is missing or went wrong. I see no error message, just a blank, loading screen.
WPBeginner Support says
You may want to go through our recommendations in our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-white-screen-of-death/
The most common reasons would be if you didn’t add the correct database name.
Admin
Montu says
Thank you!!
It worked like a charm! It was the incorrect settings in wp-config file.
You are a champ!
Thanks again!
WPBeginner Support says
Glad we could help![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Susan R. says
Thank you, thank you, thank you!! I am a novice, but your tutorials gave me the confidence to build a WP site on Localhost and then upload it to my new host. All went smoothly. I really appreciate all that you provide.
WPBeginner Support says
Glad our guides could help you![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
Paa says
I used the manual method and have issues.
Homepage of the site shows on the live server however other pages when I click redirect me to localhost pages and I cannot seem to find out to solve this.
WPBeginner Support says
The most common reason for that specific issue would be if you skipped the Velvet Blues step in this guide to update your URLs
Admin
Marek says
Can I change my test site to live site in-place ? I mean I need to convert test site into live site on the same localhost.
WPBeginner Support says
If you mean on the same hosting provider, then that would be more of a staging site in which case you would want to take a look at our guide below:
https://www.wpbeginner.com/wp-tutorials/how-to-create-staging-environment-for-a-wordpress-site/
Admin
Zion says
Pls what do you mean by
“To fix this, connect to your website using an FTP client and edit wp-config.php file?”
WPBeginner Support says
We link to it earlier in the article but we have a guide on how to use FTP:
https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
Admin
Ken says
When I am editing the staging site, there would be orders happening on my live site. How do I make sure that when I upload my staging site into my live site that the new orders would also be captured?
Thanks
WPBeginner Support says
You would want to pause receiving orders during that update process to prevent issues
Admin
Jana Boswell says
WOW, this is perfect! I could NOT migrate my site or get any of this to work before. Working with my hosting company didn’t help – they only gave me bits of information that didn’t make any sense to me. I followed your step-by-step instructions and my site is up and running! I can’t thank you enough!
WPBeginner Support says
Glad our guide was helpful![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
MarkT. says
Where can I find my login info? I didn’t see the login details from the steps, now I cannot login in to my wordpress dashboard.
WPBeginner Support says
You would use the same login information from your local installation to log into your site.
Admin
Deb Marvin says
Is there a way to migrate part of a development site and not the whole site?
I would like to migrate certain updated pages and content that is ready to go live without also migrating functionality or content that is still under development.
WPBeginner Support says
You could manually do what it sounds like you’re wanting to do by using the built-in exporter under Tools>Export and selecting the specific pages
Admin
Edidiomg says
If in the place of using an FTP, I decide to compress and upload to my cpanel then extract there, will it make any difference?
WPBeginner Support says
As long as your hosting provider allows you to do that it should be fine.
Admin
Angela Grace Vaculik says
Hello,
I have tried to upload my wordpress site created on my localhost, and used Method 1. All went well until I got to the Duplicator portion – Step 2. There is no “port” field as shown on your screenshot, so I just enter “localhost”. When I click “test database” I get a fail warning to “verify host connection” which says “unable to connect user to host”. I tried some of the troubleshoot steps to resolve but none of these work. One of the troubleshoot points states “On some servers, the default name ‘localhost’ will not work. Be sure to contact your hosting provider”. Could this be the problem?
WPBeginner Support says
More than likely, you would want to reach out to the support for your hosting provider and they should be able to assist.
Admin
Hawareyaw Petros says
Is it possible to transfer a single post from local to live word press site?
WPBeginner Support says
You would go under Tools>Export and select the single post using the options available there![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin
Oladipupo Ajisegiri says
This post is a life saver!!!
WPBeginner Support says
Glad our guide was helpful![:)](https://www.wpbeginner.com/wp-content/plugins/classic-smilies/img/icon_smile.gif)
Admin