Weap.io Docs
  • Home
  • Overview
    • What are Provider Snapshots?
    • What are Database Backups?
    • What are File Backups?
  • Provider snapshots
    • Alibaba Cloud
      • Get started
    • AWS EC2
      • Get started
    • AWS Lightsail
      • Get started
    • DigitalOcean
      • Get started
      • Multi-region replication
      • Trigger manual snapshots
    • Exoscale
      • Get started
    • Google Cloud Platform
      • Get started
    • Hetzner
      • Get started
    • OVH
      • Get started
    • Scaleway
      • Get started
    • UpCloud
      • Get started
  • Database backups
    • MySQL backups
      • Get started
      • Encrypted MySQL backups
      • Exclude certain tables from the backups
    • PostgreSQL backups
      • Get started
      • Auto-synchronize your PostgreSQL databases
    • How to decrypt a database backup
  • File Backups
    • Get started
  • Storages
    • Overview
    • How to connect your AWS S3 storage
    • How to connect your Backblaze B2 storage
    • How to connect your Azure Blob Storage
    • How to connect your SFTP storage
  • Encryption keys
    • How to generate an encryption key
Powered by GitBook
On this page

Was this helpful?

  1. Database backups

How to decrypt a database backup

If you take MySQL or PostgreSQL backups with encryption enabled, you will have to decrypt the backup before the restore.

Decrypting a backup

For this example, we assume the private key is named my-key.pem and the encrypted backup file is named my-db-backup.sql.gz.

In order to decrypt encrypted backups, you need the private key generated when you enabled the ecryption. If you don't have the key, the content of the backups is lost!

cat my-db-backup.sql.gz | openssl smime -decrypt -inform DER -inkey my-key.pem | gunzip > my-db-backup.sql
cat my-db-backup.sql.gz | openssl smime -decrypt -inform DER -inkey my-key.pem | gunzip > my-db-backup.sql

After running the command above, a new file my-db-backup.sql will be created with the decrypted database backup.

PreviousAuto-synchronize your PostgreSQL databasesNextGet started

Last updated 2 years ago

Was this helpful?