More for my own benefit than for anyone else, in case I need to do it again, these are the steps I used in migrating my web site from one hosting provider to another, keeping the same domain name. In practice it was a bit more bothersome than what’s described below, as I took a few wrong paths and had to backtrack. The two pages that I found useful in doing the migration were …
In summary, the steps I took were …
- Sign up with a new hosting provider, choosing the option to use an existing domain and configure DNS to point to the new site when ready.
- On the old site/host:
- Get a backup of the WordPress database on the old host, using the host control panel.
- Get a backup of the files on the old host by using FTP.
- I added temporary entries to my \windows\system32\etc\drivers\hosts file to point my domain name to the new host.
- On the new site/host.
- Create a new MySQL database, with the same name, user, password as on the old site. All the details I needed were in the “wp-config.php” file in the root directory.
- Use FTP to upload the files to the new site.
- Use phpMyAdmin to import content from the old database into the new database.
- Test that everything is working OK on the new host.
- Add a new blog post
- Remove (or comment out) the temporary host entries in my \windows\system32\etc\drivers\hosts file.
- With my domain name registrar, change the DNS settings to point to the new hosting provider’s name servers.
- Wait for the new site (with its new blog post) to appear when the DNS change has propagated. (The domain registrar page suggested that this can take up to 48 hours, in my case I made the change about 8pm one night, and it had propagated by the time I got up the next morning.)
One minor obstacle I had in attempting this migration was that after uploading the content to the new server in step 4 above, the front page of the site was working OK, but clicking on any links to content elsewhere resulted in a “404 not found” error.
It turned out that in step 4.B above, when I was uploading the website files, I didn’t upload all the files in the root directory, as I knew that some of them were specific to the old server not the new server. e.g. files like the error log, or config files for the fantastico installer. I got this mostly right but unfortunately one of the files that I thought I didn’t need to upload was “.htaccess” – but as this forum article steered me straight – it is needed. After uploading the “.htaccess” file, the site sprang to life as it should have.
For another WordPress site where I wanted to create a copy of the site for dev/test purposes I used the Duplicator plugin, which was pretty straightforward.