# Backups and snapshots

## The nightly backup

Your VPS Pro is backed up **in full, every night**: the system, your applications, your files and your databases. Each backup is **encrypted**, stored **off the machine**, and kept for **seven days**. It runs from outside your server: nothing to install, nothing to configure, and your server keeps serving while it takes place.

## Restoring your server

You choose the night to restore among the seven: write to support, stating:

* your server's name;
* the **night** you want, for example "the backup from the night of the 12th to the 13th";
* what happened, so that we can advise you on the right night.

Our team restores your entire server to its state on that night. Data written after that backup is not included: before the restore, copy what you want to keep from the day, a database export for example.

## Recovering a single file

A file deleted or overwritten by mistake can be found in a backup: give support the path of the file or folder and the night you want. Our team retrieves it from that night's backup, without touching the rest of your server.

## The snapshot before an update

Before a delicate operation (a system update, a new version of your database, a migration of your application), request a **snapshot** from support. It freezes your server at the moment of the request:

* it is **free of charge**;
* it is kept for **seven days at most**;
* it lets you roll back in a few minutes if the operation goes wrong.

The snapshot complements the nightly backup and does not replace it. Once your update is validated, let us know: we remove it.

## Your databases

The nightly backup copies your server as it is at that moment. For a very active database, add a **regular export**: it gives a consistent copy, which you restore to the minute of the export.

A daily PostgreSQL export, for example, with `cron`:

```
mkdir -p /var/backups/pg

crontab -e
```

```
30 2 * * * pg_dump -U postgres -Fc my_db > /var/backups/pg/my_db-$(date +\%a).dump
```

The file name changes with the day of the week: you thus keep seven exports, and the nightly backup takes them along with everything else. For MySQL or MariaDB, `mysqldump --single-transaction` fills the same role.

For one more copy, somewhere other than Simafri, `rsync` or `rclone` send your exports to your computer or to the storage of your choice.

## Frequently asked questions

### How long does a restore take?

It depends on the size of your server. Our team tells you when the switchover will take place, and your server resumes with all its addresses and its settings.

### Are my backups included in the price?

Yes: the nightly backup, its seven days of retention and the snapshot before an update are included in every VPS Pro.

### Can I get a copy of my backup?

Your data belongs to you and you can extract it at any time, over SSH, with `rsync` or your database exports. When you leave the service, ask us for a copy of the latest backup before the end of your contract (see [Billing and renewal](/en/vps-pro/facturation.md)).
