Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Migrate a Website Between Two VPS

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

  1. On the new VPS install the same stack (Nginx/Apache, PHP/Node, DB) and matching paths/users.

    # Example: sudo apt install -y nginx mysql-server
  2. Copy 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/
  3. 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.sql
    mysql -u root -p -e "CREATE DATABASE DB_NAME;"
    mysql -u root -p DB_NAME < /tmp/db.sql
  4. Test 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.

Related guides