Skip to content

Aiven Database

How to back up and restore Aiven Managed databases via SimpleBackups

Backup your Aiven database (Automatic)

In this step, we will generate a unique API Token on Aiven that will allow us to automate Aiven database backups from SimpleBackups dashboard.

1. Obtain Aiven API Credentials

Option A: Create Personal Token

  1. Go to https://console.aiven.io/profile/tokens.
  2. Click “Generate token”.
  3. Select the “Session duration” or leave empty and click “Generate”.
  4. Copy the generated Token to somewhere safe.

Aiven Database screenshot 1

Option B: Create Application Token

  1. Go to “Admin” section from top nav bar.
  2. Select “Application users” from the left side bar.
  3. Click on “Create application user” and choose a name.

Aiven Database screenshot 2

  1. From “Actions” choose “View profile”.
  2. On “Authentication tokens” section click on “Generate token”.
  3. Select the “Session duration” or leave empty and click “Generate”.
  4. Copy the generated Token to somewhere safe.
  5. Select “Permissions” from the left side bar.
  6. Click on “Grant permissions” and select “Grant to users”.
  7. Select the application user you just created and add “Read Only” role under the “Project Roles”.

Aiven Database screenshot 3

2. Get the Project Name

  1. From the nav bar navigate to “Projects”.
  2. Select “view all projects”.
  3. Choose the Project where the database exists.
  4. From menu choose “Settings” and copy the “Project Name”.

Aiven Database screenshot 4

3. Connect Aiven to SimpleBackups

  1. Afterwards, create a new provider on SimpleBackups with your Aiven API Key by going to the database backup page and click add on the “Connect your DBaaS Provider” section as shown.
  2. Select Aiven from the Provider dropdown list, enter a name for your Aiven account, then paste the Token and the Project Name we obtained in the previous step and click save provider.

Aiven Database screenshot 5

Aiven Database screenshot 6

  • Select a managed database.
  • Click on “Load”.

Aiven Database screenshot 7

Step 6: Validate and Activate Backup:

  • Click on "validate connection" to ensure all settings are correct and the connection can be established.
  • Once validated, finalize any additional backup settings (like scheduling) and activate the backup.

This process ensures that your Aiven database is securely backed up using SimpleBackups, providing an additional layer of data protection.

Create your Aiven database backup (Manual)

To create backups for Aiven database using SimpleBackups, follow these steps. The process is designed to be straightforward, ensuring that your Aiven database is securely backed up.

You can create a Backup for any Aiven Database type:

  • Aiven MySQL database.
  • Aiven PostgreSQL database.

Prerequisites

  • A SimpleBackups account.
  • Access to your Aiven database
  • Network access from SimpleBackups to your Aiven database.

1. Log in to Your Aiven Account:

  • Open the Project contains the database you want to backup.
  • Navigate to the Services section from the left menu.

Aiven Database screenshot 8

2. Configure IP Filtering:

  • Select the database you want to backup.
  • Navigate to “Network” section and choose “set public IP filters”.
  • Add SimpleBackups IP addresses to the whitelist:

Aiven Database screenshot 9

Aiven Database screenshot 10

3. Copy Connection Data

  • Navigate to “Connection information” section and copy the “Service URI”.
  • Download the “CA certificate”.

Aiven Database screenshot 11

4 Set Up Backup in SimpleBackups

  • Log in to your SimpleBackups account or create a new one if needed.
  • Navigate to creating a new database backup.
  • Choose "Serverless".

5. Fill the connection details

  • Choose the Database “Type”.
  • You can either fill the form with connection details or select "Paste Connection string" and paste the service URI.

Aiven Database screenshot 12

6. Validate and Activate Backup:

  • Click on "validate connection" to ensure all settings are correct and the connection can be established.
  • Once validated, finalize any additional backup settings (like scheduling) and activate the backup.

This process ensures that your Aiven database is securely backed up using SimpleBackups, providing an additional layer of data protection.

Restoring backups

In order to restore your backup, Go to your backup page, then navigate into logs.

Aiven Database screenshot 13

Click on the “i” button on the backup that’s on the point of time you’d like to restore to.

Aiven Database screenshot 14

Click on the Restore tab, then generate a new download link, and copy it.

Aiven Database screenshot 15

Based on your database type run these commands (for example: PostgreSQL):

bash
wget -O - "PasteTheSignedDownloadLinkHereBetweenTheQuotes" | gunzip -c > decrypted-backup.pgsql

Then, run the pg_restore command to restore your database like so:

bash
pg_restore -d "your_db_uri" ./decrypted-backup.pgsql

Aiven MySQL Database backup

SimpleBackups supports Aiven MySQL Database backup.

Aiven PostgreSQL Database backup

SimpleBackups supports Aiven PostgreSQL Database backup.