I believe that the move of this website to a new webhost is pretty much complete. I learned some things through the process and believe it might be useful to capture them here, both for my use in case I go through this again and for others who might find it through searching. I’ll explain why I chose to change webhosts and how I chose a new webhost separately. This post is about the move itself.
The WordPress site offers some help on the topic, as you might imagine. I found this article there to be useful. Read it first.
I think the biggest surprise I got was why my strategy of signing up for a new webhost and restoring my weblogs to it from a new backup before switching the domain name server information ultimately failed. Within seconds of signing up with my new webhost, I had an email from them with instructions on how to access the new website before the DNS information pointed my URL there. They gave me an IP address which worked perfectly to access the new site, get into cPanel and start organizing things. Through it, I was able to use the software loader to install WordPress.
I found that I could not do much with the new installation, however, as it referenced pages using my URL and not the IP address they gave me. So my new weblog started looking for information at the current site located at my old webhost. That, as you might imagine, didn’t work all that well.
I fiddled with it for a while, trying different things, but couldn’t get it to work, so I caved and submitted the DNS switch. Three or four hours later, I was ready to get going at the new site.
It was about then that I got my second biggest surprise. Once my DNS information switched over, the link I had to the cPanel login at the old webhost no longer worked, as it was based on my domain name. Whoops! Hadn’t considered that. Fortunately, I had saved the URL where it redirected to and was able to get it, but I never could figure out how to connect via ftp to the old site. I ended up using the file manager built into cPanel to delete all the old files.
From all of this, I have a few suggestions for this process.
- Make darn sure you’ve got full backups of your SQL databases and all of the weblog files. I ended up not using most of the blog files, but it was handy to upload themes and plugins by ftp.
- Check for URLs to connect to the old and new sites without the benefit of using your primary URL so you can manage to connect to both locations before, during and after the DNS switching.
- Write down the table prefix you defined at the old webhost in your SQL database. I don’t know whether it would have mattered if I’d changed it, but I used the same one for each of my blog databases and importing the SQL files worked without a hitch. Specify this when you configure the new WordPress installation.
From start to finish then, here’s the process I used.
- Download a backup of your SQL database from your old webhost. The cPanel at my old webhost had a backup feature but this can be done in phpMyAdmin as well.
- Download a local copy of all of your blog files from your old webhost. I use the FileZilla ftp client for this.
- Write down the table prefix you use, if any. This is in your wp-config.php file and also visible in phpMyAdmin. It is the characters at the start of the table names. If a table were named wp_commentmeta, for example, the table prefix would be “wp_”.
- Update the DNS information for your URL wherever you have your domain name registered. Wait a few hours for the change to propagate through the name server system. It took about three hours before I was able to access the new site. Note that you might need to clear your browser cache for your domain name.
- Once the DNS information has propagates, launch the WordPress installer from cPanel at the new webhost. At my new webhost, it is under the Softaculous Apps Installer section of cPanel, shown below. It doesn’t matter what you name your weblog in the setup configuration screen, near as I can tell. This will get overwritten when you import your SQL database into the new installation. Make sure you define the installation directory the same as you did at the old webhost. This is in the In Directory field near the top of the setup configuration screen. Keeping it the same should help to keep links intact, both within your site and at other people’s sites.
- Enter the table prefix you used in your SQL database at the old webhost. This is in the Advanced Option section of the WordPress installation screen.
- Click the Install button once you have everything configured as you want it.
- Once the WordPress installation process completes, go into phpMyAdmin at the new webhost. Export and download the SQL database. If something goes wrong, you can always drop the tables and import that backup to get back to where you are right now.
- Still in phpMyAdmin, select all of the tables in your new SQL database and drop them using the drop-down menu at the bottom of the screen. This empties out the database, cleaning it out for the import of your old data.
- Still in phpMyAdmin, click the Import button near the top of the screen, select your archived SQL file from the old webhost and wait for it to be imported into the database.
- Once this is done, you should be able to log into WordPress at the new webhost.
- Using a ftp client, upload files from the backup you downloaded from the old webhost to load any plugins and themes you had installed. Follow the directory structure from the archived backup.
- Upload any other files you had on your website that were outside of the WordPress file structure. I had a media folder where I stored images before that was built into WordPress, for example.
- Log into WordPress, check for any plugins that need to be activated or updated (I had to reconnect Jetpack, for example) and poke around to see if everything is working. And I’ll need to confirm later this week that my once-a-week automated backup of weblog files to Dropbox via a plugin is still working.
That process worked for me on all three of my weblogs. The key was waiting for the DNS update to propagate. Once that happened, everything when smooth as I could imagine.
The move also fixed two problems that had cropped up at my old webhost, both of which I came to suspect were driven by some change my webhost had made. That was good news, too.
I hope this helps. Let me know in the comments if you have questions or find something that doesn’t work.