VPS Snapshots and Rollbacks: Your Safety Net for Server Changes

Published on | Updated on

How to use VPS snapshots for safe experimentation. Covers snapshot strategies, automated backups, disaster recovery, and when to use snapshots vs regular backups.

Written by Jochem, Infrastructure Expert, 5-10 years experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Read author bio →

A snapshot captures your entire VPS at a point in time. If something goes wrong, roll back to the snapshot. It's an undo button for your server.

Snapshots vs Backups

FeatureSnapshotFile Backup
CapturesEntire disk imageSelected files/databases
Speed to createSeconds-minutesMinutes-hours
Speed to restoreMinutesMinutes-hours
Storage costHigh (full disk copy)Lower (incremental possible)
GranularityAll or nothingIndividual files
Best forBefore major changesDaily protection

Use both. Snapshots for safety before changes, backups for daily protection.

When to Take Snapshots

ScenarioRisk LevelSnapshot Required?
Before OS upgradeHighYes
Before major software updateHighYes
Before configuration changesMediumRecommended
Before installing new softwareLow-MediumRecommended
Before running unknown scriptsHighYes
Regular daily schedule-If available

Snapshot Strategy

Pre-Change Snapshot

  1. Take snapshot
  2. Make change
  3. Test thoroughly
  4. If good: delete snapshot (save space)
  5. If bad: restore snapshot

Scheduled Snapshots

FrequencyRetentionStorage Need
Daily7 days7x disk size (max)
Weekly4 weeks4x disk size (max)
Monthly3 months3x disk size (max)

Manual Backup Script

If your provider doesn't offer snapshots, create your own backup system:

#!/bin/bash
BACKUP_DIR="/backup"
DATE=$(date +%Y%m%d-%H%M)

# Create backup directory
mkdir -p $BACKUP_DIR

# Backup web files
tar czf $BACKUP_DIR/www-$DATE.tar.gz /var/www/

# Backup databases
mysqldump --all-databases > $BACKUP_DIR/db-$DATE.sql

# Backup configurations
tar czf $BACKUP_DIR/etc-$DATE.tar.gz /etc/

# Remove backups older than 7 days
find $BACKUP_DIR -name "*.tar.gz" -mtime +7 -delete
find $BACKUP_DIR -name "*.sql" -mtime +7 -delete

echo "Backup completed: $DATE"

Schedule with cron:

0 2 * * * /root/backup.sh >> /var/log/backup.log 2>&1

Off-Site Backups

Never keep all backups on the same server. If the server dies, so do your backups.

To Remote Server

rsync -avz /backup/ user@remote-server:/backups/vps1/

To Object Storage

# Using rclone to sync to any cloud storage
rclone sync /backup/ remote:vps-backups/

Disaster Recovery Plan

ScenarioRecovery MethodTime
Bad config changeRestore snapshot5-10 minutes
Corrupted databaseRestore from SQL dump10-30 minutes
Hacked serverRestore snapshot + change all passwords30-60 minutes
Hardware failureDeploy new VPS + restore latest backup1-2 hours
Accidental file deletionRestore from file backup5-15 minutes

Recovery Checklist

  1. Assess what happened
  2. Decide: snapshot restore or selective file restore?
  3. If snapshot: restore and verify
  4. If selective: restore specific files/databases
  5. Test everything works
  6. Investigate root cause
  7. Prevent recurrence

Testing Your Backups

A backup you've never tested is a backup that might not work:

TestFrequency
Restore a random file from backupMonthly
Restore database and verify dataMonthly
Full server restore to test VPSQuarterly
Verify backup script is runningWeekly

Space-Node's VPS hosting uses NVMe SSD storage, making both snapshot creation and restoration fast. Combined with KVM virtualization, snapshots capture the complete machine state.

What a VPS snapshot is and isn't

A snapshot is a copy of your VPS' disk state at a single moment. Most providers do this at the hypervisor layer using thin-LVM, ZFS, or qcow2 backing files. Three properties matter:

  1. Atomic: a snapshot is consistent if and only if the disk was quiesced (filesystems flushed, databases stopped) at the snapshot moment.
  2. Crash-consistent: the disk image is what you'd see if the power was yanked. Filesystems recover via journal; databases may need redo.
  3. Fast to restore: providers can roll back in seconds because the underlying storage supports COW (copy-on-write).

A snapshot is not a backup. It lives on the same hypervisor, the same datacenter, often the same physical disk. If the hypervisor fails, snapshots go with it.

Snapshot vs backup vs replica

MechanismSpeedCostOff-site?Survives hypervisor failure
Snapshotseconds~0nono
Provider backupminutesprovider tieryes (provider region)yes
Self-managed off-site rsyncvariesobject storageyesyes
Cross-region replicacontinuous2x the VPS costyesyes

Snapshots are great for "I'm about to do something stupid". Backups are for "the building burned down".

When to take a snapshot

  • Before any major OS upgrade (apt full-upgrade, kernel upgrade, distro release upgrade).
  • Before changing networking (firewall rules, sysctl, interface renames).
  • Before installing/updating game panels (Pterodactyl, AMP).
  • Before testing kernel modules, especially anything in /etc/modprobe.d.
  • Before the first boot after deploying a new service.

Restoration: what actually happens

ProviderMechanismDowntime to restore
Hetzner Cloudsnapshot replaces disk1-3 min
Hetzner Robot (dedicated)n/a (use Storage Box backups)varies
OVH Public Cloudsnapshot replaces disk1-5 min
AWS EBSsnapshot creates volume, attach5-10 min
Proxmox (self-hosted)LVM/ZFS revertseconds

Most providers preserve the same IP, MAC, and SSH host keys after restore.

Application-consistent snapshots

For databases, snapshot after FLUSH TABLES WITH READ LOCK (MySQL/MariaDB) or pg_start_backup/pg_stop_backup (Postgres). Without this, restore = "crash recovery", which works for most modern databases but not for badly-tuned ones.

What rolling back can break

  • Time-sensitive certificates: if you roll back past a renewal, certbot has to re-issue.
  • Outbound webhooks: services that talked to you between snapshot time and now have stale state.
  • DNS TTLs: if you rotated keys/IPs, clients may be cached.
  • Database streaming replication: replicas need re-init after a primary rollback.

Plan rollbacks with these in mind. A snapshot is not a magic time machine.

Jochem

About the Author

Jochem, Infrastructure Expert, expert in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 5-10 years experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

I specialize in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters.

View my full bio and credentials →

Launch Your VPS Today

Get started with professional VPS hosting powered by enterprise hardware. Instant deployment and 12/7 support included.