When migrating a website to another server: copy files, database, SSL certificate, configure the web server, and update DNS. Below is a step-by-step checklist.
Applies to:
✔ VPS
✔ Dedicated servers
✔ Linux
Using rsync (recommended):
rsync -avz -e ssh /var/www/site/ root@NEW_IP:/var/www/site/
Or via scp:
scp -r /var/www/site/ root@NEW_IP:/var/www/site/
Using tar archive (for many small files):
tar czf /tmp/site.tar.gz -C /var/www/ site/
scp /tmp/site.tar.gz root@NEW_IP:/tmp/
On the new server:
tar xzf /tmp/site.tar.gz -C /var/www/
Create a dump on the old server:
mysqldump -u root -p DB_NAME > /tmp/database.sql
Transfer to the new server:
scp /tmp/database.sql root@NEW_IP:/tmp/
On the new server, create the database and import:
mysql -u root -p -e "CREATE DATABASE DB_NAME;"
mysql -u root -p DB_NAME < /tmp/database.sql
Create a database user:
mysql -u root -p -e "CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON DB_NAME.* TO 'user'@'localhost'; FLUSH PRIVILEGES;"
Copy the virtual host configuration or create a new one on the new server.
Check the configuration:
nginx -t
systemctl reload nginx
For Let's Encrypt, issue a new certificate on the new server:
certbot --nginx -d example.com -d www.example.com
For paid certificates: copy the certificate and key files.
Update database connection settings in the website configuration (wp-config.php, .env, etc.) if the hostname, user, or password changed.
Change the domain A record to the new server IP.
Wait for DNS to update (with TTL of 300 seconds, this takes a few minutes).
After DNS switchover, run a final sync of files and database from the old server to capture changes made during migration:
rsync -avz -e ssh /var/www/site/ root@NEW_IP:/var/www/site/
curl -I http://example.com
Response should be HTTP 200. Check all website pages, forms, and database connectivity.
dig example.com +short
Should return the new server IP.
If the website does not work correctly after migration, check web server logs and database connectivity. If necessary, point DNS back to the old server (it should remain operational until full verification). Support can assist with migration.