How to migrate WordPress site from localhost to server

To migrate WordPress site from local installation to a production server follow this few simple steps. We are going to show you how to do it using popular tools – phpMyAdmin and NotePad++.

1.      Export database

-        Navigate to phpMyAdmin (http://localhost/phpmyadmin/) in your browser

-        Login to your local database

-        Click Databases

-        Click on your WordPress database name

-        Click Export

-        Leave Quick option

-        Click Go button

-        Save your sql dump file on your drive

2.      Replace service URL

You need to change your url address from http://localhost/ or http://localhost/wordpress/ or something similar to your production URL –

-        Open sql dump file which you created in step 1 with NotePad++

-        Push Ctrl+H on your keyboard – this will start Replace dialog

-        In the Find what input field enter your local URL which is going to be something like http://localhost/ or http://localhost/wordpress/

-        In the Replace with input field enter your WordPress production URL like

-        Pay attention to the last slash ‘/’ sign to replace URL in the correct way

-        Click Replace All

3.      Replace installation path (optional)

//Since there are plugins and themes out there that use wordpress installation path you might need to perform this step.

Perform step 2 to replace files installation path with the one that matches your production site wordpress folder. Remember to use full path.

For example replace C:\Development\wamp\www\wordpress with /home/users/yoursite/public_html/wordpress.

4.      Import database

-        Navigate to phpMyAdmin which controls your production database server

-        Click Databases

-        Provide your database name

-        Provide encoding

-        Click Create

-        Click on newly created database

-        Click Import

-        Click Browse and navigate to Your modified sql dump file

-        Click Go

5.      Modify wp-config.php file

-        Modify wp-config.php file to match your needs





6.      Upload instance code to server

Upload Your local WordPress files to the server to the installation directory which you have set in the step 3.

12 Responses to "How to migrate WordPress site from localhost to server"

  1. shirish says:

    CREATE TABLE IF NOT EXISTS `wp_commentmeta

    This error can’t permit me to move wordpress site to another pc OR even in host server. Pls. provide the solutions.

    • itcuties says:


      you need to give us more info about the error. This is just a CREATE SQL statement fragment. Are you getting this error while importing you database with the phpmyadmin tool or the mysql command line client?


  2. ananda says:

    HOW TO UPLOAD??????????

    • itcuties says:

      Hello Ananda,
      you can use any FTP client you like to upload data to your server.

      Have a nice day,

  3. Abdul Waudud Chowdhury says:

    Hi Itcuties,

    Thanks for the great post, its really helpful.

    I do everything from Step -1 to Step- 6, (Skip step-3) as you describe.
    Everything is ok & the Site is UP.

    But the problem is that except home page, all the page are redirect to my local server page :(

    Even i can’t login to my site Dashboard , it also redirect to my local wordpress login page.
    Site Url : “”

    Can you please suggest me what’s the problem & how i can fix this problem.

    Best Regards
    Abdul Waudud

    • itcuties says:

      Hello Abdul,

      does your database dump file contain any “http://localhost” strings? If so you need to replace them with the “” strings.

      Let us know it it helps.


  4. Abdul Waudud Chowdhury says:

    Hi itcuties,

    It works now

    Many many thanks

    Abdul Waudud

  5. Dayo says:

    trying to upload database i got this errors below: ANY HELP?

    Database: `soundtunes`

    – ——————–

    – Table structure for table `gs_commentmeta`

    CREATE TABLE IF NOT EXISTS `gs_commentmeta` (

    `comment_id` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT ’0′,
    `meta_key` VARCHAR( 255 ) DEFAULT NULL ,
    `meta_value` LONGTEXT,
    PRIMARY KEY ( `meta_id` ) ,
    KEY `comment_id` ( `comment_id` ) ,
    KEY `meta_key` ( `meta_key` )

    MySQL said: Documentation

    #1046 – No database selected

    • itcuties says:

      It seems that you are not selecting a database in your import script. Try adding set [your-database-name-here] at the beggining of your script.

  6. rydweb says:

    hey ,
    i followed all your step in this video , but it appears ,to create a new title ,, ans login with password .
    and atfer creatin , he did not show me all plugins , with contents .
    any help ? Plz thx

    • itcuties says:

      Hi there, you need to check if your database contains correct paths for your plugins. Remember that each plugin may use their own set of tables. It’s hard to say what’s wrong in your case. Please provide us with more info, like what are the plugins that you want to migrate etc.

  7. ashif says:

    how to migrate plugins to remote server


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>