Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

How to Move WordPress From Local Server to Live Site

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
How to Move WordPress From Local Server to Live Site

Developing a WordPress site locally can help speed up the development process. In the past, we showed you how to install WordPress on your Windows computer using WAMP and on Mac using MAMP. Once you have finished the development on localhost, the next step is to move the site live. In this article, we will show you how to move WordPress from local server to a live site. By using this process, you would be able to migrate all of your content (posts, pages, images, etc), themes, as well as plugins from local server to a production site.

Before we start, we must let you know that you can make this migration from local server to a live site easier by using one of the two plugins: BackupBuddy or Duplicator. In this article, we will show you how to move WordPress from local server to live site manually, so you can learn the process. However to make the process easy for us, we rely on BackupBuddy when we do this on a day to day basis.


In order for you to migrate your locally developed WordPress site to a live server, you need to have two things. First is the local server. We are assuming that you have a WordPress site running on local server, and you have full access to it. Next, you would need to have web hosting that supports WordPress, so you can migrate your content over.

You would need to have a FTP program and know how to use FTP, so you can upload your content to the live site.

Note: the screenshots used in this article are from WordPress hosting providers that have cPanel.

Step 1: Export Local WordPress Database

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.

Exporting WordPress database using phpMyAdmin

In the Export Method option choose custom, which will provide you with more options to export your database. Select all tables to export and gzipped for compression. Scroll down to the bottom of the page and press the Go button to download your database.

Step 2: Uploading WordPress Files to Live Site

Now open an FTP client and connect to your live site. 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, then you would want to upload all files in your public_html directory.

Now select your local WordPress files and upload them to your live server.

Uploading WordPress from localhost to live site

Step 3: Creating MySQL Database on Live Site

While your FTP client is uploading your WordPress files, you can spend this time on 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. Log in to your cPanel dashboard and click on the MySQL databases icon which can be found in the databases section.

Creating MySQL database in cPanel

On the next screen, create a database by entering a name for your database.

Create a new database

After creating a database, scroll down to MySQL users section and create or add an existing user to the database. After adding the user, cPanel will take you to set MySQL privileges for that user. Simply grant all privileges to the user.

Create a new MySQL user or Add an existing user to the Database

Step 4: Importing WordPress Database on Live Site

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. This will take you to phpMyAdmin where you want to click on the database you created earlier. phpMyAdmin will show your new database with no tables. Click on the Import tab in the top menu. On the import page, click on choose file button and then select the gzipped database file you saved in step 1. Lastly, press the Go button at the bottom of the page. phpMyadmin will now import your WordPress database.

Importing database in phpMyAdmin

Step 5: Changing the Site URL

Now you need to change the site URL, so you can setup your live WordPress site. In your phpMyAdmin, look for the wp_options table in your database that we just imported in step 4. If you changed your database prefix, then instead of wp_options it might be {prefix}_options.

Click on the browse button next to wp_options or the link that you see in the sidebar to open the page with a list of fields within the wp_options table. See screenshot below:

Browse wp_options in phpMyAdmin

Under the field options_name, you need to look for siteurl. Click the Edit Field icon which can be found at the far left at the beginning of the row.

Edit siteurl in phpMyAdmin

When you click the edit field, an edit field window will appear. In the input box for option_value, you will see the URL of your local install probably something like: http://localhost/test. Carefully insert your new site url in this field, for example:

Save the field by clicking the Go button.

Next, you need to replicate this step for the option name: home. The wp_options page can be a few pages long, so simply find the home tab. Usually it is on the second page which you can navigate to by clicking on the pagination arrows in phpMyAdmin.

Update the home url to be the same as your siteurl.

Step 6: Setting Up your Live Site

Now that we have imported the database, and all of our content should be uploaded, it is time to configure WordPress. At this time, your site should be showing an Error Establishing Database Connection error. To fix this, connect to your website using an FTP client and edit wp-config.php file. Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file and upload it back to your server. Visit your website, and it should be live now.

Login to your WordPress admin panel, and go to Settings » General. Click save Options. This will ensure that the site url is corrected anywhere else that needs to be.

Then go to Settings » Permalink and click Save to ensure that all post links are working fine.

Step 7: Fixing Images and Broken Links by updating Paths

Whenever you are moving a WordPress site from one domain to another, or from local server to a live site, you would face broken links and missing images issue. You can either use the SQL query or use the Velvet Blues WordPress plugin.

For those who want to do it via SQL, here is a simple SQL query that should solve this problem:

UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', '');

Simply go to phpMyAdmin, click on your database and then click on SQL from top menu. Write this query but don’t forget to change it with your own local site and live site URLs.

Fixing WordPress images and broken URLs after moving to live site

That’s all, hopefully your live site will be up and running by now. Checkout your site to make sure that every thing is working fine as expected. For troubleshooting and questions feel free to leave us a comment below and we will try to help out as much as we can.

If you are doing this on a regular basis, then we highly recommend that you get BackupBuddy because it will make your life easy. You will thank us for that later :)

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. James says:


    Any tips on how I can fix a broken link that is still using localhost for a calendar plugin that I installed?


  2. Karl says:

    I’ve bookmarked this page in the past for future reference after I had migrated my own site about a year ago. I dragged my feet getting backupbuddy and now, wow! That plugin is a bit too much for my budget. Will most likely use duplicator to migrate their site redesign from MAMP to live.

    Unfortunately, the client’s current WP install is a mess. I’m counting 6 db from previous and current site designs. I’m guessing it would be easier for me to just sweep clean all the old dbs (delete) and create a new one for my migration rather than trying to run duplicator and then have to wade through with phpmyadmin to fix any problems.

    I’ll keep this page up in my browser, just in case during migration, but I wish there was a way just to overwrite the current db with my redesign db without a need to then jump back in and make changes (via phpmyadmin). Would make the migration smoother.

    Too bad backupbuddy has raised their prices.

  3. fatemeh says:

    Hello \
    I have followed all the steps but there is nothing shown on my website , I dont know whats wrong , I do appreciate your help.

    You don’t have permission to access / on this server.

    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

    This is an error I got,

    Thank you

  4. Ian says:

    I really appreciated this tutorial – thanks. And following it to the letter has really helped solve most of my issues. However there is one that remains. The “live” site appearance looks very much like the “localhost” site, with one exception. When I go to the Dashboard and “edit” a page live, none of the text normally visible is available for me to edit. When I go to “Preview Changes” it shows a blank screen. Is there another flaw in the database structure I have missed in the conversion/upload process? Can you show me where I might have gone wrong for this to happen please? Ian

    • WPBeginner Support says:

      Try updating your permalink structure. Simply visit Settings » Permalinks and then click on the save changes button without changing anything.

  5. peter says:

    After importing the local database to live server, my cpanel phpadmin is not working. cant access it anymore.please help

    HTTP error 404

    The requested page was not found.

    Possible reasons why you are seeing this page:

    A bookmarked URL may have changed since you last visited.
    The URL was entered incorrectly.
    The URL was entered with inaccurate capitalization (URLs are case sensitive).
    Please re-check the URL you are trying to reach. (Go Back)

    Copyright© 2016 cPanel, Inc.

    • WPBeginner Support says:

      Please contact your WordPress host for support, they will be able to help you better.

  6. Rajeev says:

    Hi, this tutorial has worked very well and I have migrated a locally hosted wordpress site on to GoDaddy webhosting services however when I try to log in to my website (wp-admin) it redirects to a 404 error. Any suggestions on why this is happening and what to do to solve this?


    • WPBeginner Support says:

      Have you changed site URL? Remember and are considered two different domains. Also make sure that you haven’t installed WordPress in its own subdirectory. In that case, your wp-admin login url will be something like

  7. Gerald says:

    Hi Syed,

    I did all that was required and encountered a HTTP ERROR 500 with the notification “…currently unable to handle this request”. I’m not sure if it’s the theme I’m using that has a problem. It’s worked fine for me on another web server.

    Ant recommendations on how to fix this?

    The server seems to be running on php 5.5 while my localhost ran version 5.6. Does this affect it in anyway?

  8. vinay says:

    after completing 5th step when i go to the link mysit/wp-admin for next step I get these error plz help

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at . This could mean your host’s database server is down.

    i hv alredy udated my wp_config.php

  9. Kasoma says:

    thanks for the post but my log is not displaying and when i click the pages it shows internal server error. please help to fix that

  10. Sharon says:

    Your instructions were great, and love that you provided pictures as well.
    However, I am having an issue. I can see my site, I can see the images for the logos and pictures I have added, but the themes are not loading. They are showing up as blank. I am not sure where to start?

    When I ran your sql script through my database I get a an error #1146 – Table ‘mcintyre_wp.wp_posts’ doesn’t exist.

    Any help would be greatly appreciated!

  11. Owen says:

    This is a great tutorial, easy to follow and gets the job done!

  12. JESH says:

    Hi there, thank you heaps, I have sorted it out. My website domain is now stuck on . How do I get rid of the I am worried that if I change the URL on WordPress it will stuff everything up and I want to be sure I know what I’m doing. Appreciate the help.

  13. Najeeb says:


    Very good tutorial.

    I would like to know is it better to design a website on a local wordpress server then upload on a server like hostgator or it is also better to buy a domain on hostgator and create a wordpress website in live environment?

    Please let me know i am new to this.

  14. Jesh says:

    Hi there,
    absolute frustration has caused me comment for help. I have been trying to upload my site from local to live using MAMP and FileZilla. I have followed your steps as well as others MANY times but still to no avail. Your guide is very good and I have followed the whole thing to the end but every time I go to view my site it comes up with the domain then . The page is an “index of” page and it won’t let me go any further. I have tinkered around with the settings but really don’t know what to do except smash my computer. Can you recommend anything? …a sledgehammer?

    • WPBeginner Support says:

      When uploading files from your computer to your website, make sure you are uploading them in the correct directory. If you are not sure, then ask your web hosting service provider. Typically its called /public_html/ but it varies from one web host to another.

      Also make sure that you are uploading only your WordPress files and not including the MAMP files and directories in the upload.

  15. Gale says:

    Just wanna let you know, you guys are freaking awesome! This is such a great tutorial! I’d been stuck for days with the links not working and you’re the only ones mentioning saving the settings! Thank you so much!

  16. Rajat says:


    I just started using Hostgator. I had created a website using WAMP. I have the .sql file and the wordpress files. I am still not able to get that website show up on my domain. Can you please tell me what can i do in this regard.

    Thanks for your help.

  17. Gary Pippin says:


    I have created a wordpress website and it is still not live. When i open the url in browser it says “This url is under construction : Coming Soon”.. Could you please help me with this issue.


    • WPBeginner Support says:

      1. Your site may have a plugin installed that is used to display this page.
      2. Your domain name may not be pointing to the directory where you have your WordPress site.

      Please contact your web host, they will be able to help you better.

  18. nick says:

    i dont get it. like my site is live but it still have broken links and images. im trying to fix it with the my sql quary way but everything i fill in as local site and live site URLs it says 0 rows affected and theres nothing that changed. So can you explain which urls i have to fill in exactly

    • Julian says:

      Hello Nick,
      Are you using the query on the live phpmyadmin dashboard?
      Make sure you do it on the live site through Cpanel and not on your local environment.

  19. Kishokumar says:

    Great word buddy, i didn’t know about this until now. Thank you so much.

  20. Learner says:

    Hi, I’m learnin wordpress, I’m trying to migrate my website to a new domain and new host. Should I need to activate wordpress on my new hosting account before I load from my backup website. Thanks for your help.

    • WPBeginner Support says:

      Depends on what kind of backup you have. If it is an XML or RSS file, then you should first install WordPress and then import your content from those files. If the back contains database and complete WordPress files, then you need to extract and upload WordPress files to your new host and then import database from backup.

  21. Priyangga says:

    All works great!! but the theme doesn’t completely loaded, is the any issues? please help!!

  22. Yuri says:

    Thanks for the article, but ima kinda desperate here…

    Lost 4 hours of working trying to figure out why in my webserver the index page keeps BLANK, even after connected the database. And my admin page gives me the error not found, i’ve been searching for a solution and nothing helps.

    thanks in advance

  23. Steve says:

    Worked perfectly! Thanks.

  24. Croiche Jim says:

    thanks a lot :)


  25. precious osasumwen says:

    pls help. i get this error when i try to access my phpadmin in my wamp server.

    phpMyAdmin – Error

    Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser.

    what do i do sir

  26. Sneha says:


    I have created my website on my local server and also I have used action method to navigate to different pages. But on these action methods I have given localhost permalinks only as destination address. So do I have to replace it with live address everywhere in the code or is there some method by which i can replace it at once.

  27. Chris Cal says:

    I’m not one to usually comment but this is an excellent post.
    Great work Syed and team. Greatly appreciated.
    Cheers, Chris.

  28. Leslie says:

    It was the .htaccess file!!! But I had to upload a completely new file. Thanks!!!

  29. Courtney says:

    Any tutorials for when you have forgotten your phpMyAdmin login info? I am stuck at the beginning! It has been a while since I have needed to login and cannot for the life of me remember. I used this site as a tutorial to set up but cannot figure out how to reset. I have seen some tutorials to reset but I am afraid it is going to mess things up as I am not an expert. Any suggestions or tutorials you can point me to? TIA

  30. Tyane says:

    I’m stuck on step 6. I edited the wp-config. file and uploaded it. It gave me six errors, with most of them beginning with, ” unexpected beginning of statement” followed by the position each error is listed. I’m very new to this and my IT husband is out of town till Friday.

  31. barshan hassan says:

    Thanks… I love u

  32. leon says:

    works really well!

  33. geeuy says:

    great tutorial!
    worked like a charm!

  34. ashkan says:

    hi there tnx for this article

    i did all these steps and my site is up now but when i click on other pages or links i faced this eror
    (Internal Server Error)

    in fact I just can see the homepage

    can You tell me about This?

    • Thatguy91 says:

      I had the same issue, go to the permalinks page and click the save button. I think it needs to “resave” the permalinks again somewhere once migrated.

  35. mtahirian says:

    I have uploaded my site live. but unfortunately i can’t go to wordpress admin. the wordpress admin is working fine on local server. it has problem keep telling that : Warning: Cannot modify header information – headers already sent by (output started at /home/………/public_html/wp-content/plugins/js_composer_theme/js_composer.php:1) in /home/porseshresearch/public_html/wp-includes/pluggable.php on line 1228

    Please Help

    • WPBeginner Support says:

      Seems that js_composer_theme plugin is not working. Connect to your website using FTP and then download the plugin to your computer. After that you can delete the plugin from your server. This should resolve the issue.

      • mtahirian says:

        Thanks for responding.
        I did, as told. but the whole site is smashed up and can’t get the design correct. I need the COMPOSER.

  36. wpbeginner says:

    Thank you very much for your wonderful tutorial.
    I am having a problem where my website is only accessible through but not accessible through
    May I know what can be done to solve this?

    • WPBeginner Support says:

      Your blog is hosted as a subdomain. You will need to export it to your main domain.

      • wpbeginner says:

        My subdomain folder is in public_html folder.
        May I know where should I export it for it to be in my main domain?
        Your help is greatly appreciated.

  37. awoyemi ayomide says:

    thanks it help me a lot

  38. Lars Breum Hansen says:

    I am stuck at step 6. My site is live, but instead of going to my main page, It show my themes default main page, at gives me an 404 (because it can’t find posts, but my main page is set to be static). And I can’t login as admin, becuase then it gives me the 500 internal error?

  39. Kim Macc says:


    This article is great thank you!! I have done everything and the site is live but the pages are not linking/working i get an ‘internal server error’

    please help me fix this as soon as possible. have done the SQL query but to no avail.

  40. AP says:

    Make sure hidden files are copied over as well as part of Step 2

  41. Ebune says:

    i had a problem in the step where i am to change localhost/test. to my site name. i cant really see an edit but to change that stuff. also, when i try to upload my database, it gives me an error. please can anyone help??? am in a deep shit right now

  42. Mayur says:

    My website is
    I have changed my server , i took backup of wp files and mysql before my server service expired. Now i am on a new server, uploaded and extracted wp files in public_html, i am. Getting an error – error establishing database connection, hoe should i solve this error?

  43. Caitlin says:

    Hi! I ran into a problem in step 6: “To fix this, connect to your website using an FTP client and edit wp-config.php file. Provide the database name, user and password you created earlier in Step 3. Save the wp-config.php file and upload it back to your server. Visit your website, and it should be live now.”

    I did that and it didn’t work, so I started to edit where it said “localhost” and changed it to my domain.

    I’m a totally newbie so any help would be appreciated!

    • WPBeginner Support says:

      Try using localhost as your MySQL Host

      define( ‘DB_HOST’, ‘localhost’ );

  44. ananta says:

    owh… maan… this is what i am looking for all day long… finally found your article. it’s very helpful. now, my site is live. thank you. good work by the way.

  45. Raj jain says:


    How can I solve this error. Reply urgently.

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 32 bytes) in /home/sitename/public_html/wp-includes/pomo/mo.php on line 236

  46. Elise says:

    Hello, I’ve been following all these steps but when I’m doing the export but when I’m importing in my OVH database I can only see wp_commentmeta and wp_comments instead I’ve selected all tab during the export and choose custom and the gzipped format
    Do you know what’s happening here?

  47. Amey mankar says:

    Thank You so much. It help me alot.

  48. Mboule A says:

    I tried changing localhost to my domain name but it isn’t going. I need help. I’ve tried both methods. Both the plugins and using the SQL code

  49. Bessong william says:

    thanks you for you tutorial, but am still a beginner in web developping, i need you to teach me with a plugin like BackupBuddy or Duplicator or what ever!!!, how to migrate my website from local to live production site

  50. cmunozro says:

    Can’t access my website.
    Error al establecer una conexión con la base de datos (unable to connect to data base)

    I try accessing thorough the IP as the domain is not transfered yet. I’m not sure in the wp_options and in wp_config what data should I use.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.