# Archive Files to S3-Compatible Object Storage

Cloud Voice can offload your call recordings and system backup files to any S3-compatible object storage. S3 (Simple Storage Service) is a widely used cloud storage interface first introduced by Amazon and since adopted by many providers, so any bucket that speaks the S3 protocol works here. You can run the transfer once, on demand, or set it to repeat automatically. This page walks through registering an S3 bucket as an archive server and building the tasks that copy files to it.

:::note
The steps below apply to any S3-compatible provider. If your storage is Amazon S3 specifically, follow the dedicated walkthrough in [Archive Files to Amazon S3](/pbx/administrator-guide/archive-files-to-amazon-s3/) instead.
:::

## Requirements

**On the Cloud Voice phone system:**

- Firmware version `84.22.0.17` or later.
- An Enterprise plan (self-managed phone system) or an Ultimate plan (hosted phone system).

**On the storage provider:**

- An account with full access to the S3 resources used for archiving.

:::note
If you want Cloud Voice to delete outdated files from the bucket automatically, the storage account also needs permission to delete objects.
:::

## Limits

- Archive servers: up to 10.
- Archive tasks: up to 200.

## Step 1: Prepare the S3 storage

Before Cloud Voice can reach your bucket, set up two things on the storage provider side. Each provider does this differently, so consult their documentation for the exact steps.

1. Create an access key pair, an access key ID and a secret access key. Cloud Voice uses this pair to authenticate its archiving requests.
2. Create an S3 bucket to hold the archived files.

## Step 2: Add the bucket as an archive server

1. Sign in to the management portal and go to **System > Archive**.
2. On the **Archive Task** tab, click **Archive Server**.

   ![Archive Server button on the Archive Task tab](/images/pbx/click-archive-server.png)

3. Register the bucket:

   a. Click **Add**.

   b. Fill in the dialog that opens:

   ![Dialog for adding an S3 bucket as an archive server](/images/pbx/s3-archive-server-setting.png)

   | Setting | What to enter |
   | --- | --- |
   | Name | A label that helps you recognize this server. |
   | Server Type | Select **S3**. |
   | Region & Endpoint | The region of your bucket and its matching S3 endpoint, including the protocol (for example, `https://`). Check the provider's documentation for the supported regions and their standard endpoints. |
   | Access Key ID | The access key ID you created in Step 1. |
   | Secret Access Key | The secret access key you created in Step 1. |

   c. Click **Save**. The bucket now appears in the archive server list.

4. Close the window.

## Step 3: Create an archive task

1. On the **Archive Task** tab, click **Add**.
2. Under **Task Configuration**, set the basics for what to archive and when.

   ![Task Configuration section of a new archive task](/images/pbx/s3-archive-task.png)

   | Setting | Description |
   | --- | --- |
   | Name | A label that helps you recognize this task. |
   | File Type | Choose **Recording Files** or **Backup Files**. |
   | Data Range | The time span of files to include. You can cover up to 31 days in a single task. |
   | Sync Frequency | How often the task runs (see below). |
   | Recording File Format | The download format for recordings. This appears only for recording-file tasks, and it applies to every recording archived by the task. |

   Sync Frequency options:

   - **Once**: Archives immediately when you save the task.
   - **Daily**: Runs every day at the time you pick from the drop-down list.
   - **Weekly**: Runs on the day of the week and time you choose.
   - **Monthly**: Runs on the day of the month and time you choose.

   :::caution
   Archiving large volumes of data consumes CPU on the phone system. Schedule recurring tasks during off-peak hours.
   :::

3. Under **Storage Configuration**, choose where the files land and how they are organized.

   | Setting | Description |
   | --- | --- |
   | Archive Server | Select the S3 bucket you added in Step 2. |
   | Select Folder/Path | The bucket or folder that will hold the archived files. |
   | Storage Method | How files are grouped on the server (see below). |
   | Skip archived files | Optional; recording tasks only. When on, files that were archived before are not copied again. When off, they are archived again, the stored location is updated, but the earlier copy is left in place on the server. |
   | Delete local files after archiving | Optional; recording tasks only. When on, recordings are removed from the phone system after they are archived; they remain playable and downloadable from the management portal and the Cloud Voice App, but are no longer available from the third-party server. When off, the local copies are kept. |
   | Organize Files by Date | Optional. When on, the task creates date subfolders named `YYYYMMDD` (for example, `20260301`) under the storage path. When off, files are written straight to the path. |

   :::note
   If the selected data range holds only a single record, no date subfolder is created and the file is written directly to the storage path.
   :::

   **Storage Method** depends on whether the task runs once or repeats:

   For a one-time task:

   - **Create Task Folder**: Creates a folder named `FileType-TaskName` under the path and stores the files inside it.
   - **Save Directly to Selected Path**: Writes the files to the path with no folder.

   For a recurring task:

   - **Create Folder per Execution**: Creates a folder named `FileType-TaskName-ExecutionDate` under the path on every run.
   - **Create Task Folder Once and Reuse It**: Creates a folder named `FileType-TaskName` on the first run and reuses it for later runs.
   - **Save Directly to Selected Path**: Writes each run's files to the path with no folder.

4. Optional. Set a retention policy so Cloud Voice cleans up old files for you.

   :::caution
   Retention deletes data. Once the number of files or folders passes your **Retention Limit** (or they age past the day limit), Cloud Voice permanently removes the oldest ones from the bucket, and they cannot be recovered. Set the limit high enough to keep everything you are required to retain.
   :::

   :::note
   Retention is available only for recurring tasks, and the storage account must have permission to delete objects on the server.
   :::

   ![Retention settings for an archive task](/images/pbx/archive-retention-settings.png)

   | Setting | Description |
   | --- | --- |
   | Retention Type | **Retention by Quantity** keeps a maximum number of files/folders in the path and deletes the oldest once that count is exceeded. **Retention by Days** keeps files/folders for a maximum period and deletes anything older. |
   | Retention Limit | The maximum count or the maximum number of days, matching the retention type you chose. |
   | Retention Unit | **Folder** counts the task folders created on each run; **File** counts individual files. |

   :::note
   - The retention period is measured from the time a file is archived to the server, not from when it was created on the phone system.
   - A day means an exact 24-hour interval, not a calendar day.
   - **Folder** is available only when the Storage Method is **Create Folder per Execution**, and it does not count the date subfolders produced by **Organize Files by Date**.
   :::

5. Click **Save**.

## Result

The selected files are copied to the chosen bucket or folder right away or at the scheduled time.

:::note
Only one task runs at a time so system performance is not affected. When several tasks are due, they run one after another in a queue.
:::

You can confirm the outcome two ways:

**In the management portal**: go to **System > Archive > Archival Logs**. When the **Result** column shows **Succeeded**, the files reached the bucket.

![Archival Logs listing task results](/images/pbx/archival-logs.png)

:::note
A failed task raises the **Failed to Archive File(s)** event. Click the retry icon on the log entry to run it again.
:::

![Retrying a failed archive task from the Archival Logs](/images/pbx/retry-archive-task.png)

**On the storage provider**: open the bucket in the provider's portal. If the files are listed there, the archive succeeded.
