# Scalingo

How to back up and restore Scalingo managed databases via SimpleBackups.

Scalingo is a European PaaS platform that provides managed add-on databases for MySQL and PostgreSQL. Connecting a Scalingo database to SimpleBackups requires generating an API token and enabling internet access on the database. This guide covers both the automatic API-based setup and the manual connection string approach.

## Automatic setup

In this section, you will generate a Scalingo API token and connect your Scalingo application to SimpleBackups so that databases are discovered automatically.

### Step 1: Obtain Scalingo API credentials

1. Go to [https://dashboard.scalingo.com/account/tokens](https://dashboard.scalingo.com/account/tokens).
2. Click **Add**.
3. Copy the generated key to a safe location.

![Scalingo API tokens page with Add button](https://simplebackups.com/docs/docs-assets/media-helpkit-co/934cacb5865da9d5b659.png)

### Step 2: Get the application name

1. From the dashboard, navigate to **Apps**.
2. Choose the app that contains the database you want to back up.
3. Copy the **Application Name**.

![Scalingo apps list screen](https://simplebackups.com/docs/docs-assets/media-helpkit-co/79659542473f7ff81048.png)

![Scalingo application overview showing the application name](https://simplebackups.com/docs/docs-assets/media-helpkit-co/914e62c1cc0d9ed24e9f.png)

### Step 3: Create a Scalingo provider in SimpleBackups

1. Go to the [database backup page](https://my.simplebackups.com/backup/create?type=db) and click **Add** in the **Connect your DBaaS Provider** section.
2. Select **Scalingo** from the **Provider** dropdown, enter a name for your Scalingo account, paste the token and application name, then click **Save provider**.

![SimpleBackups provider connection form for Scalingo](https://simplebackups.com/docs/docs-assets/media-helpkit-co/0a67ae4e53bf88129104.png)

![SimpleBackups Scalingo provider saved confirmation](https://simplebackups.com/docs/docs-assets/media-helpkit-co/04112cc414d8f990b562.png)

3. Select your provider and the database you want to back up, then click **Load**.

### Step 4: Validate and activate

Click **Validate connection** to confirm that SimpleBackups can reach your database. Once validated, configure your schedule and activate the backup.

## Manual setup

Use this approach if you prefer to supply connection credentials directly rather than through the Scalingo API.

### Step 1: Open your Scalingo database

1. Open the application that contains the database you want to back up.
2. Navigate to the **Addons** section.

![Scalingo application addons section](https://simplebackups.com/docs/docs-assets/media-helpkit-co/214b610b48d019368ca0.png)

![Scalingo addon list showing the database](https://simplebackups.com/docs/docs-assets/media-helpkit-co/2b6aacc96bf55fdf5b87.png)

### Step 2: Enable internet access and download certificates

1. Select the database you want to back up and click **Dashboard**.
2. Navigate to the **TLS/Internet access** section and enable both **Force connections using TLS** and **Internet Accessibility**.
3. Navigate to the **Database TLS Certificates** section and download the certificates.

![Scalingo database dashboard showing TLS and internet access settings](https://simplebackups.com/docs/docs-assets/media-helpkit-co/e57fa9753e779dda0a47.png)

### Step 3: Copy your connection string

1. Navigate to the **Database Access** section and copy the connection string.

![Scalingo database access section showing connection string](https://simplebackups.com/docs/docs-assets/media-helpkit-co/b5cd46635c102640a641.png)

2. You can also find the full connection string including the username and password from the main application page. Navigate to the **Environment** tab and copy the connection string for your database.

![Scalingo application environment tab with database connection string](https://simplebackups.com/docs/docs-assets/media-helpkit-co/3f43d9577f8a89c01a00.png)

### Step 4: Set up a backup in SimpleBackups

1. Navigate to creating a new database backup and choose **Serverless**.
2. Select the database **Type** and fill in the connection details, or click **Paste connection string** and enter the full service URI.

![SimpleBackups database connection form with connection string for Scalingo](https://simplebackups.com/docs/docs-assets/media-helpkit-co/c12fb7cb932e5e4de4ff.png)

### Step 5: Validate and activate

Click **Validate connection** to confirm that SimpleBackups can reach your database. Once validated, configure your schedule and activate the backup.

## Restoring a backup

To restore a backup, navigate to your backup page and open the **Logs** tab. Click the detail icon on the backup you want to restore from, then open the **Restore** tab. Generate a download link and copy it.

![Scalingo backup logs tab](https://simplebackups.com/docs/docs-assets/media-helpkit-co/be1c079278fa7c7146c3.png)

![Scalingo backup detail view](https://simplebackups.com/docs/docs-assets/media-helpkit-co/982e2dcb11f5691c5094.png)

![Scalingo restore tab with download link](https://simplebackups.com/docs/docs-assets/media-helpkit-co/d588c028f1cd8af0a8d7.png)

Run the following command to download and decompress your backup (replace the URL with your signed download link):

```bash
wget -O - "<signed-download-url>" | gunzip -c > backup.pgsql
```

Then restore using `pg_restore`, replacing `<your-database-uri>` with your full database connection string:

```bash
pg_restore -d "<your-database-uri>" ./backup.pgsql
```

**Tip:**
Use the latest version of `pg_restore` to avoid compatibility issues during restore.
