Bring your own cloud: Backups and restores
A database in your own account keeps its backups in your account too. You take, schedule, restore and delete them in the console exactly as described in…
A database in your own account keeps its backups in your account too. You take, schedule, restore and delete them in the console exactly as described in Backups and persistence; this page covers where they are stored and what is different.
Where backups are stored
| Backup | Where it is |
|---|---|
| Disk snapshots (AWS) | EBS snapshots in your AWS account, in the database's region, tagged managed-by=kividb |
| Disk snapshots (Google Cloud) | Compute Engine snapshots in your project, named kividb-…, labelled managed-by=kividb, and stored in the database's region |
| Disk snapshots (Azure) | Managed disk snapshots in the resource group the connection was granted, in the database's region, tagged managed-by=kividb and kividb-cloud-account-id |
| KDB exports | Objects in the backup bucket (on Azure, the storage account and container) you named when connecting, under kividb/ |
A Google Cloud disk snapshot is stored in the database's own region rather than
in a multi-region, so it stays where you chose to run the database and is
allowed by a gcp.resourceLocations policy that lists only that region. It can
still be restored into a database in another region of the same project.
Both are subject to your own settings for the account and the bucket, such as
encryption, versioning, lifecycle rules and replication. Keep
lifecycle rules away from the kividb/ prefix, or set them long enough that an
export is not removed while KiviDB still lists it.
The bucket can be in any region. KiviDB looks up its region when you verify the
connection, and every database in the account, whatever its region, writes its
exports there. On Azure the same holds for the storage account: verification
proves the container by writing, listing and deleting a test file under
kividb/.
Deleting a backup in the console deletes it from your account as well. Delete backups in the console rather than in your cloud's own console: one removed there directly can no longer be restored.
Restoring
Backups stay in the account they were taken in, so they restore only into databases in the same connected account and region:
- A disk snapshot restores into an existing database, or into a new database created from it in the same account.
- A KDB export restores into an existing database, and can be downloaded from Snapshots in the sidebar.
To bring a file from your computer into your account, open Snapshots in the
sidebar and click Import. Choose your connected account under Store in
account, pick one of its regions, and upload a .kdb or .rdb file. The
browser uploads it straight into your backup bucket (on Azure, your storage
account and container), and it then restores like any other KDB export taken in
that account and region. The upload needs a CORS rule on the bucket, which the
setup adds on Google Cloud and Azure and one optional command adds on AWS; see
Browser uploads in the guide for AWS,
Google Cloud or
Azure.
Move data between accounts
Backups from KiviDB's cloud cannot be restored into your account, and backups from your account cannot be restored into KiviDB's cloud or into another connected account. To move data across accounts or regions:
- Take a KDB export of the source database.
- Download it from Snapshots, and put it somewhere the new database can fetch it over HTTPS, for example a presigned S3 URL, a signed Cloud Storage URL or an Azure Blob Storage SAS URL.
- Create the new database where you want it. On the review page, under Seed data, choose HTTPS URL and KDB snapshot (native), and paste the URL.
Disconnecting with backups
A connection that still has backups in it cannot be disconnected. Delete the backups first, or copy what you want to keep elsewhere. See Disconnect an account.