# Scaleway

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

Scaleway offers managed database clusters supporting MySQL, PostgreSQL, and Redis. Connecting a Scaleway database to SimpleBackups requires configuring allowed IPs, copying your connection credentials, and optionally providing a TLS certificate. SimpleBackups also supports automatic discovery through the Scaleway API. This guide covers both approaches.

## Connecting your database

### Step 1: Configure IP filtering

1. Log in to your Scaleway account and navigate to the **Managed Databases** section.

![Scaleway managed databases section in the dashboard](https://simplebackups.com/docs/docs-assets/media-helpkit-co/a6ae58a3dea9159ed073.png)

2. Select the database you want to back up.
3. Go to the **Allowed IPs** section.
4. Add the [SimpleBackups IP addresses](https://simplebackups.com/docs/help-tips-and-troubleshooting/connecting-a-server/simplebackups-ip-addresses-firewall) to the allowlist.

![Scaleway allowed IPs configuration screen](https://simplebackups.com/docs/docs-assets/media-helpkit-co/98c717ff2a6532de96b9.png)

### Step 2: Copy your connection credentials

1. Navigate to the **Network** section.
2. Copy the connection details (host, port).
3. Download the **TLS Certificate**.
4. From the **Users** tab, retrieve user details or update the user password if needed.

![Scaleway network section showing connection details](https://simplebackups.com/docs/docs-assets/media-helpkit-co/ccc4823c1369c5691047.png)

![Scaleway users tab](https://simplebackups.com/docs/docs-assets/media-helpkit-co/28ed1f8a8b4b14168dd0.png)

### Step 3: Set up a database backup in SimpleBackups

Navigate to creating a new database backup and choose **Serverless**. You can connect using either manual form fill or automatic import:

**Manual connection**

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 manual fields for Scaleway](https://simplebackups.com/docs/docs-assets/media-helpkit-co/31bfad1c8065c7b573c5.png)

**Automatic import via DBaaS provider**

1. Click **Connect your DBaaS Provider**.
2. Choose a **Scaleway** provider.
3. Select the managed database you want to back up.
4. Click **Validate**.

![SimpleBackups DBaaS provider selection for Scaleway](https://simplebackups.com/docs/docs-assets/media-helpkit-co/d7c3907e6edde0ecc964.png)

For both methods, under **Certificate / TLS**, select **REQUIRED** mode and paste the TLS certificate you downloaded.

![SimpleBackups TLS certificate configuration for Scaleway](https://simplebackups.com/docs/docs-assets/media-helpkit-co/30afa1208cb63cb196a8.png)

### 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.

## 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.

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

![Scaleway backup detail view](https://simplebackups.com/docs/docs-assets/media-helpkit-co/810538ea3db1dc283e1a.png)

![Scaleway restore tab with download link](https://simplebackups.com/docs/docs-assets/media-helpkit-co/d97e5de72a6a1189353b.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.
