This post documents the steps of moving multiple subdomain blogs from my old host to Bluehost. I had about 8 blogs to move from Lunarpages to Bluehost, and by the time I was done I had this process down to a science.
These steps are almost certainly applicable to moving from just about any shared host to Bluehost, but they are written specifically to WordPress and to the process of moving WordPress blogs that are using add on domains / subdomains and exist in folders contained within the root (public_html) directory.
If you have a bunch of WordPress blogs on one host, you probably have them set up as subdomains like this:
Most “how to move your WordPress blog” steps assume you’re moving one blog, but this post will help you move lots of blogs. This guide also assumes you were technically savvy enough to get yourself into the situation of having multiple blogs on subdomains and isn’t written for first timers.
Also, this process will take the specific site you are moving down for the some part of the move. My steps minimize the downtime, but be aware that there will be some downtime while you copy your database over to your new host. I was okay with that (it was about 25 minutes of downtime per blog), but if you’re not, you may want to look into alternative methods of moving your blog(s).
If you aren’t already a Bluehost customer and are still shopping for an excellent shared host for your WordPress blogs, personal portfolio site, etc, take a look at their current deals below:
Before you begin
Have all of these things handy:
- an ftp program (such as Filezilla)
- old host website login credentials (oldhost.com)
- old host ftp login credentials (ftp into your site)
- new host website login credentials (bluehost.com)
- new host login credentials (ftp into your site)
- domain registrar login credentials (if separate)
- about 1-2 hours to step through this process
These steps can be done any time. They won’t take your blog down, and the wp-content copy step can take a while, so feel free to start them and continue the “Moving Day” steps later.
Step 0: Log into your existing WordPress installation.
While you’re in here, make sure it’s up to date. Disable any plugins you can live without. Disable caching plugins. (You can keep all plugins enabled, but I find that they move more easily when disabled.)
Step 1: Copy your WordPress blog content to your local hard drive.
Open Filezilla (or whatever) and FTP into your old host. I use Filezilla 3.8, but you should beware of this bug with Filezilla affecting Bluehost users if you’re on 3.10 and reading this in early 2015.
Navigate to your WordPress install folder. It’s probably a sub folder of public_html.
Copy wp-content to your local hard drive. This is where all of your blog’s content is kept, and it’s really the only WordPress thing you need to copy over. Everything else will be handled by a fresh install of WordPress on your new host.
Fun fact about Filezilla: by default, there are speed limits on upload and download. Remove them by going to Transfer > Speed Limit.
Step 2: Copy anything that’s in your subdomain blog’s root folder over to your local hard drive, too.
Did you upload a favicon, a banner, an .html file for identifying your site to Google webmaster tools, etc? You might have things in your site’s root folder, so copy those things over, too.
Step 3: Copy your blog’s sql database to your local hard drive.
- Log into your old host’s cPanel.
- Find phpMyAdmin and log in.
- Find the database associated with your blog (and click it)
- Click Export in the toolbar at the top
- The default settings are fine
- Click OK
- You’ll download a .sql file – hang onto this for later
If you have lots of blogs on one host, you might have lots of databases and they may have cryptic names. If this is you, look in the table with the _options suffix to verify which db goes with which blog.
Wait, there’s one more thing!
How large is your .sql file? If your .sql file is under 50mb, skip ahead to “Moving Day”. If it’s larger than 50mb, I have some bad news: Bluehost won’t let you upload it via phpMyAdmin. You’ll have to use .ssh and the command line to upload your database. Those steps are further down in this guide, but they’ll add 1/2 to 2 hours to this process depending on how experienced you are with .ssh and how quickly you can get set up and logged in.
If your database is under 50mb, you can keep following along in the next section.
These steps will take your blog offline while you complete them. Expected downtime is less than an hour, depending on your db size.
Step 4: Change your nameservers to Bluehost’s (or whoever’s).
Log into your registrar (I use and love Dynadot) and find the domain of the blog you are moving. Change its nameservers to the nameservers Bluehost tells you to use for your account.
For me, that’s:
Step 5: Add the “add on domain” to your Bluehost account
Log into Bluehost, go to cPanel, and look for Add on Domains. Enter your domain into the field and wait for Bluehost to validate it.
After Bluehost validates your domain, scroll down. Keep the “add on domain” radio button checked. Create a new directory for this add on domain. I like to name my add-on directory after the WordPress site it’ll soon hold.
Step 6: Return to cPanel, install WordPress.
Bluehost has (or at least had) a quick “Mojo Marketplace” WordPress installer. I like to reconfigure the defaults and name my site SiteNameBLUEHOST to help me identify its database later on, since Bluehost gives the WordPress databases cryptic names.
Choose your subdomain out of the list (I always pick the one without the .www, might just be personal preference).
Wait for the install to complete.
Step 7: In your FTP program, log into Bluehost and upload wp-content into the new install’s directory.
You just installed WordPress, so navigate to its folder via your FTP program and when you find wp-content, copy your site’s version of wp-content over it. This step may take a while.
Step 8 (small database): Replace that new Wordpress installation’s database with your site’s exported database. (This only works if your database is under 50 mb).
While wp-content copies, you can log into Bluehost’s cPanel again and go to phpMyAdmin.
Find the new database and click it. If you have a lot of databases, look in the table with the _options suffix to identify the correct one. (This is why I like to name my new blog installation something identifiable, especially when dealing with multiple sites. That blog title you entered at installation time will show in _options.)
With the correct database open, click “Check All” and choose With Selected: “Drop”. (Drop is database speak for “delete”).
Now use Import to import your existing .sql file into this database. Note the prefix used. (In my screenshot above, the prefix is wp_ but not all of the databases I imported came with wp_.)
Step 8 (large databases over 50mb): Log into your server via ssh and import your gigantic database using the command line.
If your database is over 50mb, congratulations – you get to use. ssh to upload your database instead because Bluehost’s implementation of php doesn’t let you modify the maximum upload size (BOOO).
Bluehost offers some guides to this process, which (when put in order) are basically:
- Enable SSH on your Bluehost account
- Generate a set of public/private keys
- Set up Putty if you’re on Windows and log into Bluehost via Putty
- Import your MySQL database via command line
The import command is really the only tricky part. It needs all of the following:
- Your database’s username. This is not your Bluehost account name. The database user is defined when you set up the database and is probably prefaced with your db name. You can see a list of users associated with your databases by clicking on MySQL Databases in Bluehost’s cPanel and scrolling all the way down to where the users are kept.
- Target database’s name. This is the database you’re going to overwrite. By default, Bluehost WordPress databases have cryptic names like youraccountname1_wo1234. If you have a lot, make sure you know which one is the one you want to overwrite.
- .sql file name. You have this on your hard drive, and you’ll need to upload it to your account into a place you can find easily while you’re in the terminal (you can just dump it into public_html via your ftp program, just remove it when you’re done).
Go back to your FTP program (hopefully wp-content is done copying over by now) and upload your .sql file somewhere on your Bluehost account. I just dumped mine into public_html (you can remove it later). (What was that about .ssh being more secure?)
Now go log in via Terminal (Mac) /Putty (Windows). Remember, you are on your account’s part of Bluehost’s server, not your local hard drive. Use pwd and ls to get your bearings. Navigate (cd foldername) to the folder you uploaded your .sql database file and run the command that imports it.
That command will look something like this:
mysql -p -u username_wo1234 username_wo1234 > yourdb_filename.sql
Uploading through .ssh got the job done, but using it for the first time came with a lot of kinks to work out and added nearly 2 hours to my site’s downtime. Hopefully, the steps detailed above will help you do it faster than I did.
Step 9: Hook up the database by ensuring $table_prefix matches.
If you’re here, congrats – you’re through the hardest parts. There’s a small chance your site is already working.
There’s a larger chance, however, that your site is just a white page or a database connection error message. This step fixes the database connection problem. If you don’t have that problem, skip ahead to the next section.
In Bluehost cPanel, go to File Manager.
Navigate to public_html and click on the directory where you’ve set up your blog. Inside, you should find wp_config.php. Right click the file and choose Code Edit.
Inside, look for $table_prefix on or around line 65. Make sure whatever’s here matches what your db actually uses as a prefix.
If you had a database connection problem, there’s a good chance this solved it.
Step 10: Disable plugins to fix blank white WordPress page
If you’re getting a blank white page, try logging in directly via yourblogurl.com/wp-admin. If you can get in, try disabling plugins until the site loads.
If you can’t get in, go into File Manger and find the plugins folder. Right click it, choose rename, and rename it something else – like pluginsX. Doing this will disable all of your WordPress plugins. Now try yourblogurl.com/wp-admin. If you can get in, reactivate plugins from within your admin panel.
If none of that works, try these steps from Bluehost to try to fix the “white screen of death”.
I found that firewall and security plugins were the most likely to get messed up in the move process and, at worst, had to be reinstalled from scratch.
Step 11: Help, all my blog links are DEAD! 404s everywhere!!
In your new WordPress installation, in the dashboard/admin column down the left side, go to Settings > Permalinks. Note the structure they are currently using.
Select Default (so your links look like http://yourdomain.com/?p=123). Save changes.
Try your links now – do they work? If so, go back to Permalinks and change them back to the way they were. If they don’t work, try editing a post and saving it.
Step 12: Set up email addresses, forwarders for your site.
Chances are, you had some nice email@example.com for each of your WordPress sites, probably with forwarders to the main address you use. This step is just a reminder to go to Bluehost’s cPanel and recreate those, along with the forwarders.
Step 13: Move banners, favicons, Google tracking codes, .htaccess, etc back into root folder.
If your sites are like mine, you have a few special things in the root folder of your site. This is a reminder to re-upload those things to your new host.
At this point, your subdomain blog should now be fully moved over to Bluehost! Well done!
I hope you enjoyed this guide, and if you spotted any errors or outdated information, please let me know in the comments.
And, in case you’re curious, yes, I love Bluehost. I was a Lunarpages customer for 9 years but Bluehost outclasses it in every way – bandwidth, CPU allocation, ability to handle the traffic my blogs collectively pull in, uptime, ease of use, and customer service.
If you’re not already a customer, check ’em out – Bluehost is my favorite shared hosting service for my blogs. (Read more about my blogging-for-profit hobby here).
Note to readers: Tilcode is a participant in Bluehost’s affiliate program.