amuck-landowner

How to run hosting server so it can be easily backed up and restored under any server provider?

ICPH

Member
When You setup a Linux server for example for the purpose of the website hosting, you probably want to easily backup it and in case it went offline, you want to restore it in one minute on a server from a different provider. You do not want to install all the software and configure things while your site visitors cannot access your site.

What are the options to achieve that quick backup/restore setup?

Ideas (feedback wanted):​


1. rsync/tar non system files (untested)​

a)
sudo rsync -aAXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt
b)
sudo tar -czvf /path/to/backup.tar.gz --exclude=/path/to/backup.tar.gz --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/run --exclude=/mnt --exclude=/media --exclude=/lost+found --exclude=/backup /
c)
sudo tar czf /backup.tar.gz \
--exclude=/backup.tar.gz \
--exclude=/dev \
--exclude=/proc \
--exclude=/sys \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/run \
--exclude=/media \
--exclude=/lost+found \
/

2. On a KVM VPS (i do not need dedicated server), install some virtualization (maybe with a Proxmox panel), which allows snapshots. I suspect snapshot can cause certain downtime.​

a)
KVM - "KVM supports live migration, a feature that allows running VMs to be moved from one physical host to another with minimal downtime." ... "KVM provides higher portability due to its ability to run different operating systems and applications in isolated VMs."
b)
LXC - "LXC containers share the host’s kernel. This shared kernel approach reduces overhead, making LXC containers more efficient in terms of resource utilization. ... LXC an excellent choice for environments that prioritize efficiency, speed" ... "Efficient resource use, minimal overhead, simple setup"

ChatGPT thinks that the option b) would be more performing: Dedicated server(ran by my provider) -> KVM VPS(rented by me) -> LXC VPS(setup by me to allow backups) -> web server

3. Can I run a ZFS or a BTRFS filesystem​

on my rented KVM VPS and thanks to its snapshot feature, transfer snapshots off the server and somehow restore these snapshots under different server with ZFS while this server is running?
"there is a risk of jeopardizing the consistency of the ZFS filesystem if the parent dedicated server is rebooted or powered off unexpectedly" ... "consider using tools like ZFS snapshots and replication to create redundancy and protect against potential data loss" ... MySQL is said to require locking/flushing or stopping to ensure good backup.

4. Use some high-availability multiserver setup​

where two (or more) servers are kept in sync. I have not found any such setup for less than 3 servers, which would not require lets say $15+/monthly subscription.
https://www.ovirt.org/ - free, runs on CentOS 9 or RedHat - "High availability of virtual machines in the event of host failure"
 
Top
amuck-landowner