[WordPress] How to change your webhost or domain and still retain all the settings

Sometimes, we can be mad about our webhost (due to shitty downtimes etc) and would want to move on to a better host. You would even want to change your domain name.

Here’s a complete tutorial on how to make the move and still retain ALL your blog posts, comments and settings. I have made this tutorial, as noob friendly as possible.

PS: You can skip some the third part if you just want to move to another webhost (not the domain).

Exporting MySQL Database from Server 1

1) Open PHPMyAdmin, select the database where you have wordpress installed. Click on Export.


2) Most probably you won’t have to care about the configuration. Just press “Go”

3) You’ll have a database. Select All (Ctrl + A) the text, Copy (Ctrl + C) and Paste (Ctrl + V) it on a Notepad (Run –> Notepad).


Creating MySQL Database on server 2

1) Goto your Control Panel. Click on MySQL Databases.

2) Create a new database (say yournewwordpress)

Preparing MySQL Database from server 1

1) Click on Edit –> Replace.

Find : youroldwebsite.com

Replace : yournewwebsite.com

Press Replace All


2) Change this to your MySQL Database name

Database”: ‘yournewwordpress’


3) Very rarely there can be problems with the upload path.

Search for “upload_path”. Make sure its like this:

‘upload_path’, ”, ‘yes’);

4) Save file as UTF-8


Uploading / Importing Modified MySQL Database to server 2

1) Open PHPMyAdmin and then choose “yournewwordpress” database on the sidebar. Now, click on the import tab.

import bar

2) Just upload your SQL Database and press go.


Taking care of wordpress files

1) Open File manager and goto “public_html” Select All and Compress. Download this file.


2) Upload this file to server 2 and extract.

3) selec wp-config.php and press edit.

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘putyourdbnamehere’);

/** MySQL database username */
define(‘DB_USER’, ‘usernamehere’);

/** MySQL database password */
define(‘DB_PASSWORD’, ‘yourpasswordhere’);

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

Now goto yourwebsite.com/wp-admin check if it worked, else submit a comment below.


1) Obtain your MySQL Database from your first webhost.

2) Prepare it for the upload.

3) Upload it to the second webhost.

4) Enjoy!

PS: This tutorial can be a little tricky for some people. If you need any help, you can contact me or comment.

So lazy that he can’t even fill this column out.

  • Mark


    I am wanting to make a clone site of a site I made for some friends.

    If I upload it to server 2 in a new directory how will it affect this part:

    “Preparing MySQL Database from server 1

    1) Click on Edit –> Replace.
    Find : youroldwebsite.com
    Replace : yournewwebsite.com
    Press Replace All ”

    At the moment I have it setup so that the hosting address is masked by the domain name. i.e. examplesite.server.com converts this address to myurl.com

    Any help on this is very much appreciated.


  • If your “clone” is on a different domain… then yes..

  • Gayan

    Hi Suhas,

    Hey man excellent stuff. Now my question is related to that WP to BLogger plugin-of yours but I think you have disabled Commenting on that post, so I’ll throw the question through this :).

    My question is that, after importing all the images in Picasa to the WP-hosting server, will one lose the image traffic?

    or in other words, do we have to redirect images separately … is there even such a thing??

    I ask this because I’m very new to these stuff and thinking about moving from Blogger to WP and want everything on WP hosting. I’d appreciate if you have time to put together an answer.

    Thanks dude :)…

  • Anonymous

    Hi Gayan,

    Before the wordpress site is getting indexed, the images stay at picasa. So, when people come about searching for the images, they’ll bump into your blogger site. Thanks to the redirects, the visitor will now be redirected to your wordpress site.

    Eventually, when the wordpress site is indexed, those picasa images will replaced by the on site images in the search results.

    So, no image traffic will be lost.

    Hope that clarifies your doubt.

    BTW, thanks for bringing that to my notice, I have enabled commenting on that thread. I was rather curios about the comment-less tutorial.

    Thanks and regards,

  • Gayan

    Thank Suhas…. I really appreciate this

© 2010 Suhas Tech. All rights reserved.
Proudly powered by Wordpress.