Backups to your own S3
Continuous backups are not included in Zkrinet yet. Until then you are responsible for backing up your data (terms, section 7). The easiest way is built into PocketBase: automatic backups uploaded to an S3 bucket you own. It takes ten minutes to set up, and the copies land outside our server from the first night.
#What you need
- An S3-compatible bucket at a provider you choose and pay for. Prefer one with servers in the EU, for example Hetzner Object Storage (Germany/Finland), Scaleway (France) or a Swedish provider.
- The bucket's endpoint, region, access key and secret key. Create a key that can only reach this bucket.
The provider you choose is your own provider. It is not covered by our data processing agreement, so check that it has its own if you store personal data.
#Set it up in the admin panel
- Open the project's admin panel and go to Settings → Backups.
- Turn on Enable S3 backups storage and fill in endpoint, bucket, region, access key and secret. Click Test S3 connection.
- Under Backups cron, set a schedule, for example
0 3 * * *for every night at 03:00, and how many backups to keep (Max @auto backups to keep). - Save. Click Initialize new backup once to see the first copy land in your bucket.
The backup is a zip of pb_data: the database, the settings and uploaded files stored locally. If you have set up S3 for files under Settings → Files storage, those already live at your provider and are not part of the zip.
#Restoring
In the admin panel under Settings → Backups you see the list of backups in the bucket. Restore reads one back and restarts the project. You can also download the zip and run it locally with ./pocketbase serve, exactly like an export.
Test a restore once after setting this up. A backup that has never been tried is an assumption.
#Files on your own S3
The same principle applies to uploaded files: under Settings → Files storage the project can store all files in your own S3 bucket instead of on our server. Then the files do not count against your storage quota, and large volumes of files become your own choice of provider and price. Note that files already uploaded are not moved automatically when you switch, they must be copied to the bucket by hand, and files on your own S3 are not part of our export since they already live with you.
#Good to know
- The backup is taken by PocketBase inside the project and counts against the project's CPU and memory while it runs. Schedule it at night.
- PocketBase does not encrypt the zip. Choose a provider that encrypts at rest, or a bucket with object lock if you want to protect the copies from deletion.
- We never see your keys and cannot reach your bucket. If you lose them, create new ones at the provider and fill them in again.
- The snapshots we take before every deploy remain regardless, see Backups.