I just completed my first ever hosting switch from GoDaddy to Bluehost. Aside from a couple of easy to fix errors, it went off without a hitch. Since I’d never done this before, I was pretty concerned. I wanted to do it a year ago, but wasn’t sure I could handle it. Now I’m mad I didn’t do it sooner. The process is a little time consuming, but it isn’t hard. I’m going to try to recount how I did everything, and hopefully this can help you out!
The Preparation (Nothing will change yet with your hosting, we’re just getting ready)
Buy new hosting! I know, it seems a little bit obvious, but you need to have new hosting to get started. It only took me 4 days to move everything from start to finish. I’d still recommend buying new hosting a couple of weeks to a month before your current hosting expires. That’ll give you plenty of time to make and fix mistakes.
It might be a good idea to make a post on your site(s) before beginning the process here letting folks know that it isn’t a good idea to leave comments or anything. Or wait until after you have all the files on your new server. Anything done on your site after the database export, and bfore the nameserver change will get lost.
Also consider deactivating your plugins. At least any that cache data, or have absolute path settings in them (/home/r/v/o/rvoodoo). They may throw errors when you switch over. If you forget, it’s no problem. I forgot, and remedied the problem in seconds.
Files: You’re going to need to learn how to use ftp here. No way around it. I use filezilla since it’s free and open-source. I’m not going to go in depth how filezilla works, there are tonnes of documents and tutorials available to help with that. Basically you log on to your server using the credentials you get from them and you have access to all your files.
The program itself works similar to Windows Explorer. Your computer is on the left, your server is on the right. Drag and drop what you want to copy. How long this will take depends on your internet connection speed, your hosts speed, etc. I downloaded about 15 gigs in a couple of days. To start with, you really want to copy everything in your web folder (www, html, public_html) to a folder on your computer.
Databases: I used phpmyadmin on my host’s website to download my databases. I logged into phpmyadmin, selected each database, and exported them. The codex or google can help you here with specifics. Godaddy had assigned each database a really obscure name, which the resulting downloaded .sql file was subsequently named. I just renamed each export as I downloaded it, so I would remember which site it applied to.
DNS Entries: I learned ths one the hard way. Once you transfer nameservers (we’ll get to that soon), your registrar may drop all your custom DNS entries. I had one of my domains running on CloudFlare and had switched my nameservers over to them, along with all associated DNS entries. When I switched back to GoDaddy, all my custom entries were gone. So if you have anything custom set up – for instance: google apps email MX entries, google apps CNAME forwarding for calendar, etc, or another CNAME for forwarding, like to posterous – either export the DNS settings, or copy them down. Also, copy down the main IP that the A @ points to.
Do Some Housekeeping
Maybe you set up some subdomains or directories, and they have goofy names. Now is the time to change those folder names (Only ones that you will be routing domains/subdomains to). Any old cache or database backups? Move those out of your files (keep them on your computer, but no need to upload them to your new host). Any host specific folders that you don’t need on your new host? I had several things that godaddy put on my hosting…. get rid of those. Also, look out for any server specific code on your site. I had an .htaccess directive that was godaddy specific, and it blew my site up. IT was a simple fix to comment it out, but it made my heart skip a beat, and took a couple of hours to figure out.
Do NOT alter any file structures or anything, programs like WordPress will freak out if you change anything it needs. Other than unneeded garbage or subdomain related directories, keep files and folders in the same structure. Don’t move anything around.
The Setup (We’re still not changing anything, but we’re starting to play on our new host)
Upload all those files: It’s time to bust out the FTP program again. Now we will do the opposite. Move everything onto your new host. I just copied over everything that I had downloaded from godaddy (html folder) to bluehost (public_html folder). Again, this may take a couple of days, just let it go! When complete, you should have the exact same file structure on your new server that you had on your old, minus any junk.
Create some databases: I can’t get all detailed in this section. Although I’ve only used 2 hosts, the processes for creating databases was completely different in each. Your host should have some documentation about creating databases for you. Set up a new database corresponding to each of your old ones. Make note of the database name, database user, password, and host for each database, we’ll need that soon.
Import your mySQL: Again, I can’t get too detailed. You can look to the codex or google for help. I simply went into phpmyadmin, selected the appropriate database I had created, and clicked import, then selected the right .sql backup file from earlier.
Connect your new databases: This is where we need the database info you recorded earlier. For each database, you need to edit your config files to point to the new databases. In WordPress, that is in the wp-config.php file. I also had a RoundCube install, and a Yourls install to deal with. A couple of Google searches helped me figure out which files needed changing. Once you input the credentials, your sites are connected to your databases.
Bonus edit: I went into each of my sites on my new host and threw in an html comment. This is header.php for all my wordpress sites (in my active theme) and index.html or index.php in other sites which were’t WP based. I dropped it under the title:
<title> Your title, or maybe a call to wp_title in WP sites </title> <!-- FROM NEW HOST -->
Since I only put this comment on my sites on my NEW host, I could view my source and tell when my sites had switched over.
Some Backend Work (Still not throwing the switch, your site will keep working on the old host)
This info is pretty specific to Bluehost, I think. I’ll just spew some stuff out, hopefully it is helpful to some of you.
Set up the domains: Before actually changing my nameservers over, I was able to fully configure all of my domains and subdomains. On bluehost in the domain manager, I was able to configure add-on domains. I had to verify I owned the domain. Luckily I could do that by creating a verification html file on my OLD host that let Bluehost know I owned the domain. Once I proved that I owned the domains, I could tell Bluehost which folders the domains would be routed to.
Set up subdomains: Once I had my domains set up, I could add subdomains to them. I was also able to point my subdomains to their appropriate folders. Easy as pie!
Set up the DNS stuff: Earlier we documented any custom DNS entries we had for each of our domains. Now is the time to put them back in. I had to add in my google apps MX entries for all of my domains, plus my verification CNAME stuff. I Also had a variety of CNAME entries on my main domain to add in, for google apps and other services.
Quick Review Before we Throw the Switch
Let’s take a look at what we’ve done so far. We started by buying new hosting with lots of time to experiment. Then we downloaded everything, all of our files, and exported our databases. We recorded all of our DNS info. We cleaned up our files and pulled out any junk. Then we uploaded our files, made new databases and imported all of our info. We connected the databases to the files. Finally we configured the backend, setting up our domains, routing all of our domains and subdomains, and entering in our DNS info. That’s all the prep work… here we go!
Throwing the Switch
Now all that is left to do is throw the switch, so-to-speak. Log on to your registrar, whoever you bought the domain name from and find out where to change your nameservers. WRITE DOWN your existing nameservers. If something goes terribly wrong when you change, you can change back and get your old site back online while you troubleshoot.
Now put in your new nameservers. You can find these out from your new host. For example, on GoDaddy I changed from NS21.DOMAINCONTROL.COM and NS22.DOMAINCONTROL.COM to Bluehost NS1.BLUEHOST.COM and NS2.BLUEHOST.COM. Save those changes, and wait!
It can vary how long this takes, mine never took longer than an hour. I could tell when it happened because of that html comment I put on my sites earlier. That my friends, is the entire process. Well all of it except:
I don’t have too much to go over here, not much went wrong following the above process. I did have a couple of issues.
If you switch nameservers, and then switch back check your DNS entries. Mine all got wiped out, including the main A @ IP address that controls everything. Instead of routing to my site, I got routed to a godaddy holding / ad page. That’s why I mentioned recording all of your DNS entries, including the IP address.
When one of my sites switched over, it blew up. Stay calm and read the error messages. Mine mostly pertained to plugins. I hopped onto ftp and renamed the folders of those plugins to deactivate them, and got back into my site. One f the plugins was caching images using my file structure path, which had changed as a result of the transfer. Deactivating / reactivating fixed it. Another plugin had the file path hardcoded into it, I just had to enter my new path.
That’s all I got. This is by no means a complete tutorial, or even necessarily the best way to do it. Just an informal discussion of how I transferred painlessly. The big thing here is to plan. Make sure you have everything you could possibly need backed up and documented. And read the help files on your hosts. I did, and learned a lot! If you have any questions, send ’em my way. I’m no expert, but I did it! I can try to help. If you have any more info to share, or stories to tell, please leave me a comment! For further information, the codex is always your friend!
NOTE: The Bluehost links on this page are affiliate links. I don’t include many of them on my site, but I figure if I’m happy with a service, and recommending it, why not throw in a couple of links. Just in case ya’ll feel like helping a guy cover his hosting costs.