Last weekend I had to move 5 WordPress installs to new hosting with new domain name and make a redirect from the old one. In this post I’m going to describe the process I went trough. I hope it will be in use to somebody.
1. Make back-up of the old site – back-up all files, back up the database (make .sql export file of all tables)
2. Create new database and user in the new hosting
3. Go into the .sql back-up file from the old database. Search for all instancess of domain-name.com and change them with new-domain-name.com. If your database dump is very big, that might take some time.
4. Open wp-config.php from the back-up files. Change the information for connecting to the database. Write the new database name, new database user name, password…
5. Upload all files you downloaded from the old site, to the new hosting.
6. Import the .sql dump into the new database
7. Log into the new web site, by using the same username and password you used for the old site.
8. Test if everything is working properly, if anything is missing
9. If everything is fine – make a redirect from the old site to the new one. Open the .htaccess file (at the old install) and add the following code:
RewriteRule (.*) http://www.website.com/$1 [R=301,L]
If you already have RewriteEngine On – just paste the other two lines under it. Don’t forget to write your new web site domain name instead of http://www.website.com/
11. Go to your old domain name. If it drops an server error refresh and than you should be redirected to the new domain. Congratulations, you made it!
Point 1: You might use xCloner to create your back-up package. It will contain all your files and .sql dump of the database. This will save you time downloading hundreds of files. XCloner also has options for direct transfer of back-up to new hosting and extracting there – Restore xCloner back-up
Point 3: if you don’t do that part, than all posts will contain the url of the old domain name as well as all attachments. It’s very important you make the find and replace.
Point 5: It’s easier to make a zip of all files, than upload the zip and extract it online. This might save you an hour if your web site is big. Not all hosting providers support unpacking of zip files. Anyway, if yours supports it -you can do it from the File Manager in cPanel.
Point 8: Some plugins always make problems when you move the website. For example you will lose half of your information from Contact Forms 7. Some widgets might need to be placed again and filled in. Theme settings also get lost – header image, background color. If you use Easy Post Types for creating custom content types you will be in a small trouble. All the posts for your custom content types will be imported, but they won’t be visible as the content types won’t be present themselves. Go to your old install in Post Types -> Utilities – select All Post Types and Export. Copy the code and import it in the new install’s Post Types Utilities menu. After this, you should have all custom content types working normally.
If you are using Simple:Press as forum platform – you will need to reselect all your preferences and settings. Simple open in one tab the settings window of the new forum and another those of the old.
Notice: That was my experience. You might have different plugins and your case might vary a bit. But in any instance, it’s not big deal and it’s very easy to do.