HostGator.com » Support Portal

How to transfer your wordpress blog from one host to another host

Before you start with WordPress Hosting

If you are a new HostGator customer, or you are upgrading your HostGator plan, then you may be eligible for our free content transfer service. Read more here.

If you are moving from a host where you used cPanel, you can perform a Full Backup and HostGator will help you restore it. This will save you from needing any of the below steps.

Backup your Wordpress database using phpMyAdmin

First thing first, make a backup of your database using phpMyAdmin. Once you have successfully logged into phpMyAdmin (cPanel -> MySQL -> phpMyAdmin) , click on the name of the database which contains your WordPress blog. Then click on Export in the main navigation area, within the export screen you must complete the following steps:

  • click on ’select all’ and ‘SQL’ from the Export menu
  • select ‘add Drop Table’, ‘add Auto_Increment value’ and ‘enclosure table and field names with blackquotes’ from the Structure menu
  • select ‘Complete inserts’ and ‘Use hexadecimal for binary files’ from Data
  • you can leave all the other values at their defaults

Once all those settings are selected you simply click on ’save as file’, this will download a file named wordpress.sql to your desktop. And that is that. You have successfully backed up your database.

If you don’t have PHPmyadmin installed on your hosting account, you can use mySQLDump from a SSH terminal.

Download/Upload all your WordPress files using FTP.

You will need to download ALL your files from your old host and upload them to your new host.  This includes files from your themes folder and plugins folder. Make sure you also download any folders which were referenced outside of your blog folder. For example I use a seperate folder called ‘images’ which is located outside of ‘blog’. If I didn’t copy and upload this folder to my new host I would have a lot of broken links to images within my blogpost. This is not a pretty sight.

The FTP client I use is Filezilla. By default Filezilla does not display your .htaccess file, probably for security reasons but I’m not too sure. To ensure that your .htaccess file is included in your download you must click on ‘View’ and then enable ‘Show Hidden Files’. If you neglect to upload your .htaccess file then your permalinks will not work.

Please note that you should not take this oppurtunity to update to a newer version of Wordpress. Your database may not sync’ as a result. Complete your migration before you consider upgrading.

Edit wp-config.php and create a new Wordpress database.

First, head to your control panel and click the MySQL Databases icon. You need to create a new database with a name appropriate for your blog. Also, you will need to create a database username and password. Finally, assign the new user to the new database and grant "All Privileges".

Okay, so we are nearly there. You must now edit wp-config.php to include the database settings of your new database.

/** The name of the database for WordPress */
define('DB_NAME', 'cpuser_dbname');

/** MySQL database username */
define('DB_USER', 'cpuser_uname');

/** MySQL database password */
define('DB_PASSWORD', '******');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Once you have edited the file with your new database settings, upload it to the root of your blog folder (unless you edited the file on the server).

So now everything is set, except that your new database does not contain any database tables.

Import your Wordpress blog to your new Database.

You can use either phpMyAdmin to import your database or you can use BigDump.  BigDump is the preferred option if you have a large database (10mbs or more). There is a step by step guide on how to use BigDump on their website.

Once you have logged in, you can choose between two methods to complete the import. You can click on ‘SQL’ and run a query or you can use the ‘Import’ link to upload your wordpress.sql file into your database. I recommend using the latter, as the query may take a long time and can sometimes crash your browser. Using the import feature is less strenuous on the browser.


My blog works, but I cannot upload images.

You may be seeing an error like "Unable to create directory. Is its parent directory writable by the server?" Here are the most common solutions:

  1. Login to your wp-admin, click on Settings and then choose the Miscellaneous option from the left menu. The path should display wp-content/uploads. If not, fix it.
  2. If you still have the same problem, login to the cPanel > File Manager or your FTP client and make sure the permissions of your wp-content folder is set to 755.
  3. If you still have the same problem, make sure all WordPress folders have 755 permissions, and all WordPress files have 644 permissions.

My blog works, but is missing the CSS style. Or when I click any links, I am taken to my old site.

This is due to WordPress storing your domain name as a piece of data in its database. Here is the way HostGator recommends to fix the problem.

  1. Go to yourblog.com/wp-admin/ and login.
  2. In the left hand menu, click Settings.
  3. Click General.
  4. Next to WordPress address (URL), enter the correct domain and path.
  5. Next to Blog address (URL), enter the correct domain and path (usually the exact same).
  6. Scroll all the way down and click the Save Changes button.
  7. Return to your blog; it is fixed!

I cannot get to myblog.com/wp-admin/ and login.

Read the related article about "WordPress Home Fix". This is more technical, but works every time.


Article Comments

Charles Baldwin
This did not work exactly as noted. When I tried to import my database, I kept getting an error message. What I finally did was update my WP blog to the latest issue on my old server. Then I used Fantastico to install WP on my HG account. Once I set up a database and WP populated it, then I downloaded my old DB and site and then Imported the old DB into the new one. I then copied my files over onto the WP files on my HG account. I did not include the config.php file that I edited, nor did I include my .htaccess file. Everything works fine now.

mani
how to run an sql query? if we were that intelligent / knowledgeable, we would not have come here in the first place. So please take the time to explain things a bit.

HostGator
This entire article is written for phpMyAdmin users. There is a tab at the top called 'SQL', and clicking it allows you to run MySQL query statements.

If you do not already know this, then that is why we recommend using the Import tab instead.

david
Everything was fine until it was time for me to save the file in step one. It says to click on save as file, and it will save a file called wordpress.sql. It does not. It saves a file called localhost.sql.

Is that the same, or am I doing something wrong?

HostGator
Sounds like you did not click the database name before you clicked Export.

Anne
My blogsite is currently at wordpress and I'm thinking of getting my own domain name and have the site hosted here. The instructions above are all too technical for me...

Wordpress has an export tool that creates an XML file and according to the description, I can use it to upload my blog contents (although it didn't say "including the pictures") to a different blog. Will that work here?

HostGator
When you move to HostGator, we offer free content transfers for your new hosting plan. Please consider taking advantage of that service, instead of trying to transfer the content by yourself.

Read more at http://support.hostgator.com/articles/free-domain-content-transfers-for-shared-web-hosting

Tony
I moved my root folder with cgi bin and htaccess files all together.
Did a straight up copy paste of it into the new host and thats it everything is working no problem.

I did not have to create a db in the new server.

Brian
To move a wordpress blog from a baby account to a reseller account the following sequence is required:

In the original baby CPanel
Make a zip file of the home directory and download to local machine. Then go to the wp_config.php file for the wordpress blog in question (via file manager) and find the database file name.
When you know which database you need, do a back up of the database to your local PC

In the new CPanel
Upload zip file for home directory and extract to the public_html (25Mb max)
Restore database from back up
Create a new mysql user and add to the database
Update the wp_config.php file for the new database name, user and password.
Update wp_options for the temporary URL
Site should now load on temporary URL
Update wp_options for correct domain name and upload path (it needs changing to the new server route)

At the domain registrars
Change nameservers to new server and wait to propagate.

Obviously there is a lot of detail required to do all these tasks which you need to ask Hostgator for, but this is the full sequence of events.

Jerry
I have successfully imported to my new host and It loads up fine but then when I click on a page the addressed above loads the old host. is there a reason for this?

HostGator
You still have the old domain name in the WordPress database.

Read the last paragraph above for the solution.

roc-o-rama
Followed instructions to the 'T" and it worked like a charm! I'm loving Hostagator, ON MY old host this was such a big PAIN IN THE A$@!

Mark
Got my site transferred successfully, but when I try to set up my permalinks as "day and name" wordpress tells me it can't write to .htaccess.

I modified permissions on .htaccess without success, and also made the recommended changes to .htaccess manually, but neither worked. I get a 404 on all post pages. Any suggestions?

HostGator
Please contact HostGator via email, phone or live chat for personalized assistance.

descargar FAP Turbo gratuito
Esto realmente resuelto mi problema, gracias!

Carl
This discussion is about "How to transfer your wordpress blog from one host to another host." I'm trying to find out how to transfer my blog from one domain to another (new addon) domain. I'm not trying to change hosts.... Does that work the same?
Thanks

HostGator
You want the Related Article, "WordPress Home Fix".

James
The instructions helped a lot. I really was not comfortable giving access to my "old" host provider's files and databases, so I chose to migrate myself. It was easy with your instructions, but to test on my new Host Gator account I didn't have a valid working HTTP URL. Online chat support gave me this and also confirmed for me the WordPress table needing the URL updates as well (wp_option, option_names site_url and home). After that and a little waiting everything started to work great. Thanks.

AmombHamy
I love it! Could perhaps be a tad more polished, but it’s far better than what we use at the moment, nonetheless,thank you very much.<a href="http://www.uggsaustraliabootsshop.com">Cheap ugg boots</a>, <a href="http://www.uggsaustraliabootsshop.com">ugg boots</a>, <a href="http://www.uggsaustraliabootsshop.com">ugg boots sale</a>

KAY
Super useful and practical. Thanks for all of the effort.

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment