How to Migrate Your BIG WP Sites to A New Server WITHOUT Downtime?
I recently migrated a WordPress website from an old VPS to a new one. The process took considerable time and effort, so I wanted to document my journey for others who might face a similar challenge.
The Challenge
The main difficulty was the website’s size—almost 2GB in total. Migrating such a large site isn’t straightforward using standard methods.
Initial Attempts
My first approach was manual migration:
- Exported the database.
- Downloaded compressed files from the old VPS.
- Uploaded files and imported the database to the new server.
Unfortunately, this method repeatedly ended in errors. I suspect the database was too large, which may have caused data loss during export.
Switching to Duplicator Pro
Next, I turned to the Duplicator Pro plugin (for Big size website migration). This tool allowed me to export both the database and all files together. I won’t go into the details of using Duplicator Pro, as there are plenty of tutorials online, and the process is quite simple.
Avoiding Downtime: The Right Way to Switch
Many people migrate a website and immediately update the DNS to point to the new VPS after uploading everything. They do this because you typically need the DNS pointed to the new server to run installer.php
. However, this approach is risky—if something goes wrong during installation, your website could go down.
The correct method is to wait to change your DNS until you’ve fully tested the site on the new server. This helps prevent any downtime.
How to Test Your Site on the New Server Before DNS Change
You can do this by editing your local “hosts” file to point your domain to the new server’s IP address. This way, you’ll see your website as it appears on the new server, while everyone else still sees the site on the old server.
Steps:
Open Notepad as an administrator.
Go to File > Open
and navigate to: C:\Windows\System32\drivers\etc
Open the hosts
file and add these two lines at the end:
1.2.3.4 yourdomain.com
1.2.3.4 www.yourdomain.com
(Replace 1.2.3.4
with your new server’s IP.)
Save the file.
Now, visit yourdomain.com/installer.php
in your browser to initiate the installation on the new server. The rest of the process is straightforward—just follow the prompts to restore your website.
Final Steps
Once you’ve restored the website and confirmed everything works correctly:
- Remove the two lines you added to the
hosts
file and save it. - Update your DNS settings at your domain registrar to point your domain to the new server’s IP.
If you follow these steps carefully, your website should be running smoothly on the new VPS with no downtime.
For more details, you can reference this helpful guide:
https://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-to-a-new-host-or-server-with-no-downtime/