25Aug2008
Filed under: Social
Author: Pawel Szulencki

Loading ...
If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. Thanks for visiting!
In my previous post “How to move WordPress blog from old domain to new domain with 301 permanent redirection” i describe how to move your WordPress blog to new domain name without moving to new hosting provider. This time lets see how to move your entire blog to new hosting provider.
Preparations
- Back up your whole SQL database including your posts, comments and everything else you have on your current blog. To back up your database follow the guide at WordPress Codex. You should back up your database once in a while and every time before an upgrade of your WordPress blog.
- Back up all files of your blog, images, core WordPress files, plugins and all other files by downloading the whole WordPress directory to a save location (preferably on your hard drive) using your favorite ftp client. You may also refer to WordPress guide to read more about Backing Up Your WordPress Site.
- Put the Robots.txt file to your new hosting with the code:
User-agent: *
Disallow: /
- Close all comments on your old blog to prevent people from commenting until you move to the new location by simple SQL query in your PhpMyAdmin panel:
UPDATE wp_posts SET comment_status='closed'
- Check your back ups! It’s really important.
Keep the same domain name but change the hosting provider
If you are going to keep the same domain name, but you decided to move to another hosting company all you need to do is edit the wp-config.php file and upload all files and database to the new host.
- Upload all your files (WordPress core files, images, plugins, everything your blog existed of) to the new hosting company.
- Create a new SQL database with your NEW hosting provider with the same name and password as the old one.
- Go to PhpMyAdmin in the NEW hosting company and import the whole SQL database.
Or…
- If you want to create a new database with new name and password go to the NEW hosting company and create the new database.
- Next open the wp-config.php file on your blog located in the root folder of your WordPress blog.
- Change the:
define('DB_NAME', 'putyourdbnamehere'); // The name of the database
define('DB_USER', 'usernamehere'); // Your MySQL username
define('DB_PASSWORD', 'yourpasswordhere'); // ...and password
to the new database data that you have just created.
- Save the wp-config.php file and upload to the new server.
- Read more about editing wp-config.php file at WordPress guide.
Use WordPress build in Export feature
You may also do the following to keep your WordPress blog and change the hosting company:
- In your OLD blog go to Manage > Export panel and in “Restrict Author” check “All Authors”.
- Click “Download Export File:.
This file will contain your posts, pages, comments, custom fields, categories, and tags of your old blog.
- Perform a new installation of a WordPress blog on the new host. Go here to download the latest WordPress version.
- In the new blog, after installation is complete go to Manage > Import and click on WordPress on the bottom of the page.
- Now select the file you have exported from your hard drive and click “Upload File and import”.
- You will see a page where you need to assign the author to users that already exist or you may create new users. This will assign all posts from the old blog to the new author on the new blog. You should keep the same author name as in the old blog.
- Click Submit.
- Click on “Have fun”.
- Upload all files you have changed to the new blog location. That means all themes, plugins, files you have changed from the old blog to the new one.
NOTICE: This will add all the posts from the old blog to the new one, it will NOT delete the posts you have on the new blog.
You may also read more at WordPress about moving the blog.
Final steps
- Now that you have moved all files and updated the SQl database check all files again, see if everything is working TWICE, all themes, plugins, check everything to make sure its all fine.
- Remove all WordPress blog files from your old hosting provider.
- Remove the old database.
- Remove the Robots.txt file from your NEW server to enable all search engines to spider the site.
- Keep the backed up versions of you blog just in case.
Good luck in moving your WordPress blog.
Sphere: Related Content
Sarah of basement flooring (1 comments.)
August 28th, 2008 at 12:26 am
Thanks for the very useful tutorial, i was thinking of changing my web host for quite sometime but was not sure how difficult it will be transfer my wordpress. This tutorial has made my work easy.
Sarah of basement floorings last blog post..Basement Flooring: Form and Patterns
Pawel Szulencki (68 comments.)
August 28th, 2008 at 10:17 am
No problem Sarah. My pleasure to be able to help.
Mr Dogy (1 comments.)
September 29th, 2008 at 8:23 am
wow.. great tutorial
can you add with pictures maybe with picture can make easy to understand especialy for newbie like me..
good work pawel szulencki
Pawel Szulencki (68 comments.)
October 5th, 2008 at 2:17 pm
@Mr Dogy: Im glad you like the tutorial i wrote. Maybe i will add some pictures when i have more time to that post. Thanks for pointing that out.