I used to migrate my WordPress sites using a very simple—but not efficient—way.
Either I’m using a plugin (which usually results in corrupt/incomplete transfer), or use a browser to download the zipped files and then upload them again to the new host.
It’s simple, it works, but at some point, it doesn’t work that great anymore due to the increasing size of the websites. Web hosts simply will stop the download before it even reaches 10%.
At the end of last year, I decided to move to Bluehost since they’re so cheap and they’re decent enough for simple blogs like mine.
And finally, I forced myself to learn how to use FTP to migrate WordPress files.
Actually, FTP is the standard for people wanting to migrate or manage their files, but I always thought that using FTP is hard and complex since an FTP software usually looks like it was designed for an actual tech guy.
So, here’s how I migrate my WordPress websites now.
1. Install a blank WordPress installation on the new host.
First things first, I will install a new blank WordPress installation and fill in all the necessary details the same as the website I’m going to move.
It’s pretty easy to install a fresh WordPress installation, so no need to write the details here.
2. Download all the necessary files from the old host using an FTP program.
Usually, the content of the wp-content folder is enough, but if you want to be more sure, download everything that falls under the public_html folder (or custom_folder_name folder in my case) using the FTP program (I’m using FileZilla).
Since some of my websites has many files, this usually will take a long time since the software will download all the files one by one.
Or, if you want to make things faster, compress all the files first via cPanel and then download that file instead.
3. Download the database from the old host using phpMyAdmin.
Usually, a standard host will have this feature, and with phpMyAdmin, I can download the database of the website.
Make sure you got the right database by seeing the database name and matching it with the ones in the wp-config.php file.
Choose the Export tab and then export the database using the default setting.
4. Upload the files to the new host.
Now we will use FileZilla again to upload all the files we’ve downloaded to the new host.
Upload them to the public_html folder or the custom_folder_name folder and replace all the existing files and folders.
It could take a while, depending on the number and size of your website.
5. Drop the current database on the new host, and upload your database, replacing it.
Now back to phpMyAdmin, but this time on the new host.
Choose the new database (it will have a different name from your old database) and then drop the current database, meaning it will get deleted.
And then upload the database you’ve downloaded from the old host and replace the default database.
6. Change the prefix of the database on the wp-config.php file on the new host.
Since the wp-config.php file in the new host still points to its default database prefix, we need to change it to the newly uploaded database prefix.
Doing it is easy, just edit the file via cPanel and then replace the prefix with the right one and then save the file.
7. Point your domain name to the new host, and assign it to your WordPress installation.
Now, you can modify the database to change the website’s URL to a temporary URL your host gave to check if it’s running without any problems, or you can just trust the whole thing and start pointing your domain name to the new host.
In my case, I changed the URL to the temporary domain name Bluehost gave me for the first website I migrated, just to make sure things are working. But for the rest of my websites, I immediately log in to Namecheap and point the domain name to Bluehost nameservers.
Sometimes the domain propagation is quick, and sometimes it takes hours.
After your host detected the domain name, assign it to your WordPress installation.
8. Once you can log in, open Settings -> Permalinks and click Save Settings to refresh all the URLs.
In many cases, you can access your homepage right after you assign the domain to the proper WordPress installation, but somehow other pages aren’t working and you’ll get some errors and a blank page.
I don’t know why this happens, but I do know that we must log in to the WordPress dashboard and then go to Settings -> Permalinks and then click Save Settings to update/refresh all the URLs.
All of the URLs should be working normally by now.
9. Make sure your website is running smoothly by testing each page in your browser.
This is the last step just to make sure there isn’t any error or missing files before finally deactivating your old host account.
This is why I usually migrate a month before my host expiry date, so if something is going on, I could just revert the website to the old host by changing the nameservers again on the domain registrar.
So there you go, a quick and simple guide to help me remember how to migrate my websites just in case I need to do it again in the future.
*All of the necessary details about the technical aspects should’ve been easy to google in case you’re wondering.*