Skip to content
VeloxMedia
VPS guide

A Practical Backup and Snapshot Strategy for Your VPS

Replicated storage protects you from hardware failure. It does nothing about a deleted table, a bad deploy or ransomware. That is what backups are for, and a plan with three layers covers almost everything.

Intermediate · About 3 min read · Updated 27 October 2026

Replication is not a backup

On VeloxMedia, every disk is replicated across nodes, so a failed drive or host does not lose data. But replication copies every change instantly, including mistakes. If you run DROP TABLE or a script deletes a directory, the replicas faithfully do the same. Backups give you points in time to go back to.

The three layers

  1. Snapshots for instant rollback before risky changes.
  2. Scheduled backups of the whole server, kept off the host, for recovery from bad days.
  3. Application-level copies (database dumps, file sync) stored with a different provider or location, for the worst days.

Layer 1: snapshots before changes

Take a snapshot from the control panel before OS upgrades, major application releases, schema migrations or anything you are not sure about. They take seconds and restoring rolls the whole server back. Treat them as short-term: delete them once the change has proven itself, because they are not a substitute for scheduled backups.

Layer 2: scheduled server backups

Enable scheduled backups in the control panel so full-server copies are kept off-host automatically. Restoring rebuilds the server from a chosen point, which is the fastest way back from a compromised or badly broken system.

Layer 3: database dumps and off-site copies

Whole-server backups of a running database can capture files mid-write. A logical dump is consistent and portable:

# PostgreSQL
sudo -u postgres pg_dump -Fc mydb > /var/backups/mydb-$(date +%F).dump

# MySQL / MariaDB
sudo mariadb-dump --single-transaction --routines --triggers mydb | gzip > /var/backups/mydb-$(date +%F).sql.gz

Then send dumps and important files to storage outside your hosting account, so a lost password or a compromised account does not take the backups too. restic encrypts, deduplicates and works with S3-compatible storage, SFTP and many other targets:

sudo apt install -y restic
export RESTIC_REPOSITORY=s3:https://s3.example.com/my-bucket/web1
export RESTIC_PASSWORD_FILE=/root/.restic-pass
export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=...
restic init
restic backup /var/backups /var/www /etc
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune

Put the dump and restic commands in a script and run it nightly from cron or a systemd timer. Store the restic password somewhere other than the server; without it the backups cannot be decrypted.

Retention that makes sense

A simple schedule that suits most sites: daily backups kept for a week, weekly for a month, monthly for six months. Ransomware and silent corruption are often noticed late, so older copies matter more than people expect.

Test restores

A backup you have not restored is an assumption. Once a quarter:

  1. Deploy a temporary Micro or Small server.
  2. Restore the latest dump and files onto it.
  3. Check the application starts and recent data is present.
  4. Note how long it took, then delete the server.

The time it takes is your real recovery time, and it is far better to learn it on a quiet afternoon.

Checklist

  • Snapshot before every risky change
  • Scheduled off-host server backups enabled
  • Nightly database dumps
  • Encrypted off-site copies with sensible retention
  • Backup password stored away from the server
  • Quarterly restore test on a scratch server

Common questions

What is the difference between a snapshot and a backup?

A snapshot captures the server at one moment for quick rollback before a change and is meant to be short-lived. A backup is a scheduled copy kept for longer, ideally off the host, for recovery from mistakes, corruption or compromise.

If my storage is replicated, do I still need backups?

Yes. Replication protects against hardware failure but copies every change instantly, including accidental deletions and ransomware. Backups provide earlier points in time to restore from.

How should I back up a database on a VPS?

Take regular logical dumps with pg_dump or mariadb-dump using consistent options, keep several days of them, and copy them to storage outside your hosting account.

How often should I test restoring a backup?

At least once a quarter, and after any major change to the backup process. Restore onto a temporary server so you measure real recovery time without touching production.

Deploy your first server in under a minute

Pick a region, choose a size and connect over SSH. No setup fees, cancel anytime.