---
title: "Set up Amazon S3 Storage"
url: https://phatdev.net/en/docs/sl-migrations/amazon-s3-step-by-step
lang: en
updated: 2026-10-20
alternate:
  vi: https://phatdev.net/docs/sl-migrations/amazon-s3-step-by-step
markdown: https://phatdev.net/en/docs/sl-migrations/amazon-s3-step-by-step.md
---

# Set up Amazon S3 Storage

Part of the doc set: [SL Migrations](https://phatdev.net/en/docs/sl-migrations.md)

> Connect the plugin to Amazon S3 to store backups.

## Amazon S3 Storage

> Note: the current SL Migrations build does not include Amazon S3 or other cloud storage (those SDKs were removed from this build); only Local and FTP/SFTP are available. This article is kept for reference and does not apply to the current build.

## 1. Create an S3 bucket

1. Sign in to the AWS Console → S3
2. Click **Create bucket**
3. **Bucket name**: a globally unique name (for example `sl-migrations-backup-yourname`)
4. **Region**: choose the region closest to your WordPress server
5. **Block all public access**: LEAVE IT ON (do not disable it)
6. **Versioning**: Disabled (saves storage)
7. Create

## 2. Create an IAM user

1. AWS Console → IAM → Users → **Add users**
2. Name: `sl-migrations-backup`
3. **Access type**: Programmatic access
4. **Permissions** → **Attach policies directly** → **Create policy** (see [IAM Policy Setup](https://phatdev.net/en/docs/sl-migrations/amazon-s3-policy-setup))
5. Save the **Access Key ID** and **Secret Access Key**

## 3. Add the storage in the plugin

**SL Migrations → Storage → Add New → Amazon S3**:

| Field | Value |
|---|---|
| **Storage Name** | A display name, for example "S3 Backup" |
| **Access Key** | From IAM, step 2 |
| **Secret Key** | From IAM, step 2 |
| **Bucket** | The bucket name |
| **Region** | The bucket's region |
| **Storage Folder** | `backups/` (optional) |

Click **Test Connection** → you should see success.

Save.

## 4. Configure the storage for a package

**Packages → Create New → Storage** → tick "S3 Backup".

The plugin will:
1. Build the archive locally
2. Upload it to S3 once the build finishes
3. (Optional) Delete the local copy after a successful upload

## 5. Restore from S3

**Packages → Import → From Storage** → choose S3 → list the archives → pick an archive → Import.

Or download it locally first through the AWS Console or the AWS CLI:

```
aws s3 cp s3://your-bucket/backups/archive.daf .
```

## Retention policy

The plugin can delete old backups automatically:

**Storage → Edit S3 → Max Packages**: the number of backups to keep in S3. When the limit is exceeded, the plugin deletes the oldest backup.

## Lifecycle rule on S3 (recommended)

Set up a lifecycle rule on the bucket to move old backups to Glacier automatically (cheaper):

```json
{
  "Rules": [{
    "Id": "Move to Glacier after 30 days",
    "Status": "Enabled",
    "Filter": { "Prefix": "backups/" },
    "Transitions": [{
      "Days": 30,
      "StorageClass": "GLACIER"
    }]
  }]
}
```

## See also

- [IAM Policy](https://phatdev.net/en/docs/sl-migrations/amazon-s3-policy-setup)
