Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have my WordPress site being hosted on a Windows provider and I am moving to another Windows provider. Any gotchas or instructions on how i can smoothly transition from one to another without losing any info?

share|improve this question
    
Maybe it would also be interesting to get hints on how to minimize downtime or content overlap, with the time needed to transfer database contents and DNS migration. Or should we discuss that at Pro Webmasters? –  Jan Fabry Oct 9 '10 at 9:56

6 Answers 6

up vote 11 down vote accepted

Hi @ooo:

Assuming you want to keep the same domain, it's really quite simple. Basically you copy the files using an FTP client by downloading from the old host and uploading to the new one, and then you copy the MySQL database by doing a database dump to a SQL script (this is your "export") and then running the script (and this is your "import".)

The rest are just details:

1.) Use FTP to download all the files from the web root and all its subdirectories of your old hosted web server.

2.) Upload all those same files to the web root of the new hosted web server in the exact same named directories.

3.) Do a full database dump (i.e. export) of your MySQL database as a SQL script.

4.) Create a new MySQL database at your new web host.

5.) Create a user for your MySQL database and set it to have all permissions. Be sure to record the name of the database, of the user and of the password.

6.) Import your MySQL database by running the MySQL script in context of your new database.

7.) Next edit your /wp-config.php file on your new server and give set DB_NAME, DB_USER and DB_PASSWORD to your new database name, new database user name and new database user password.

7.) Finally, be sure to change your domain's DNS settings so it uses the name servers from your new web host. You;ll need to wait the timeout for the DNS cache to clear and the addresses to propagate (typically it only takes a few hours but it can take up to 48 before your new site is accessible.)

Thats about it. If you need more specifics be sure to give a lot more details about your new host including minimally the name and website of your new host and if possible what type of control panel they offer for you to administer your site (i.e. CPanel or something else?)

share|improve this answer

The main gotcha when changing servers are hard-coded urls and file paths WP. They appear:

  • In the upload path option, under settings / misc (now settings / uploads, if memory serves), on old WP installs.

  • In attachment meta data, on very old WP installs.

  • In your htaccess file, and possibly rewrite rules, if your site lives in a subfolder.

  • In the site URL and home URL options, under settings / general.

I generally recommend to turn permalnks off before creating the db dump, to avoid the 3rd issue.

The 4th issue prevents you from logging in, and can be fixed from the wp config file, if your site changes URL, by adding two lines to wp-config.php:

define('WP_HOME', 'http://domain.com'); define('WP_SITEURL', 'http://domain.com');

Mind trailing slashes in both defines.

The first issue's symptom is that you'll get permission errors when uploading files. It is fixed by making the upload path empty, so that WP uses the default value.

The second issue is only fixed by mass editing the database. But again, it's only valid for very very old data.

The rest is like Mike said...

share|improve this answer

So to come back and answer my own question and hopefully help someone else, the permalinks are easily rewritten by changing the permalink scheme in Settings > Permalinks. Change it, then change it back and your .htaccess file will be fixed.

The 2nd problem, the warning message, was a plugin that wrote a static link when I installed it. I deactivated, then reactivated it and it did the trick.

edit: thanks Lisa, just saw you there!

share|improve this answer

I use BackupBuddy (http://pluginbuddy.com) for all my migrations. It's a premium plugin and it's not perfect but it's much better than anything else I've found.

share|improve this answer

@Nick - I had the same problem where the main page loaded but none of the links. I changed Permalinks from Custom to Default and then it worked. I changed back to my custom settings later, and all worked out.

share|improve this answer

protected by toscho Jul 2 '12 at 21:41

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.