Moving VPS

I thought I would share a few thing regarding moving between two VPS. First I was nerves if it would work painlessly , however I was stunned how easy it was with our setup . I have to admit there is still room for improvement in the point of view of security and best practice , but the outcome was still a pleasant surprise . Took me 15 minutes to get all service back online after shutting them down for safe backup process.

Let’s call our first server VPS A and the other one where we move VPS B. Preparation of VPS B was quick installing WireGuard server with previous config file , secure ssh and installing docker and docker-compose.(Future improvement idea: writing Ansible playbook for this process)

The backup and moving process has started with stopping all services on VPS A ( to lower risk of losing some data), used duplicati to create an encrypted backup in AWS S3 storage. Start duplicati on VPS B and import the exported backup settings From VPS A . While this happened I modified the DNS records to our new VPS publicIP . After the backup had to change a few places in .env files to set the new public ip for some services. And then with one command everything started up .

docker-compose -f $service0.yml -f $service1.yml ... up -d

Our setup was 5-6 essential services (Matrix server, hedgedoc, file share etc) and couple adhoc services Like a separated ssh and web server for moving data painlessly from untrusted devices.

With Ansible involved it would made all this even easier, but for our purpose at the moment it was perfectly fine. Still amazed me how easy it was to move between servers.