Migration is more than copying folders: clone data, test on the new VPS, then flip DNS when it responds. This flow avoids nasty surprises.
Steps
On the new VPS install the same stack (Nginx/Apache, PHP/Node, DB) and matching paths/users.
# Example: sudo apt install -y nginx mysql-serverCopy files from the old VPS (dry-run first if you prefer):
rsync -aHAX --info=progress2 -e ssh root@OLD_VPS:/var/www/site/ /var/www/site/Dump and restore the database:
ssh root@OLD_VPS "mysqldump -u root -p DB_NAME > /tmp/db.sql"scp root@OLD_VPS:/tmp/db.sql /tmp/db.sqlmysql -u root -p -e "CREATE DATABASE DB_NAME;"mysql -u root -p DB_NAME < /tmp/db.sqlTest via /etc/hosts pointing the domain at the new IP; if OK, lower TTL and change the A record.
dig +short your-domain.com A# Update DNS at your registrar/panel
Tips
- Take a final dump right before the DNS cut so you do not lose orders/comments.
- Keep the old VPS for 48–72 hours in case you need to roll back.
ext step
A clean landing zone for the move: Deploy your Cloud VPS.