Backing up a VPS: snapshots or files

On an unmanaged VPS, backups are your job unless your plan says otherwise. What we say about a daily copy and 30 copies applies to shared hosting accounts, and should not be taken for granted on a VPS. Check what your plan includes on the VPS server page and in your service in Meu Interweb, and if it is not written there, assume you have no backup at all.

Snapshot or files

Disk snapshot File backup
What it is An image of the whole disk at one moment. The folders and databases you choose, copied somewhere else.
Restoring Everything at once, the system included. You set up a new server and put things back on top.
Weak spot If taken while the database is writing, it may catch it half done. And it usually sits next to the server. It takes work to set up and the restore has to be tested.
Available? Only if your plan offers it. Do not assume. Always, you have root.

The rule that holds for both: the copy must live somewhere else, off the VPS disk. A copy on the same disk is lost with it.

A file backup, the minimum that works

1 List what matters: the configuration in /etc, the site or application folder, the databases, and the data volumes if you use Docker.
2 Export the databases first. A copy of the database folder while the service is running is not reliable. For MySQL or MariaDB, mysqldump --single-transaction --all-databases > all.sql. For PostgreSQL, pg_dumpall. See backing up with mysqldump and pg_dump, and restoring.
3 Bundle it into an archive: tar -czf /root/backup.tar.gz /etc /var/www (swap the folders for yours).
4 Send it off the server. rsync -avz over SSH to another computer or server does this well; on later runs it sends only what changed.
5 Schedule it with a cron job and keep a log of what ran. See cron jobs and automatic backups of your own application.
6 Test the restore on a practice server. A backup that was never restored is a hope, not a backup.
Containers and volumes. If your application runs in Docker, the backup has to include the volumes where the data lives, and the database should be exported, not copied while live. For n8n and Evolution API there are guides of their own: backing up n8n and updating and backing up Evolution API. And a disk full of images and logs takes your room away: Docker filling the disk.
Keys and passwords are part of the backup too. A copy of a database without the key that encrypts it, or the certificates, may be useless. Keep them apart, somewhere safe.
Who is responsible for what on an unmanaged VPS is written in managed or unmanaged VPS and how far our support goes. The first security steps are in keeping your VPS secure.

Want to know what your VPS plan includes about backups? Ask us, with the name of the service.

Open a support ticket

SEE ALSO

Automatic backups of your own application: cron and mysqldump

Backing up with mysqldump and pg_dump, and restoring the copy

First steps with your VPS

Managed or unmanaged VPS: which to choose and who does what

RECOMMENDED PRODUCT

VPS server with root access

Resources of your own, the OS you choose, reinstall whenever you like. from $7.61/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?