# Archive Files to Amazon S3

Cloud Voice can copy your call recordings and system backup files to an Amazon S3 bucket, either on a recurring schedule or as a one-off transfer. This page walks you through preparing an Amazon Web Services (AWS) account and bucket, registering the bucket as an archive server, and building the tasks that move your files.

## Requirements

| Item | Requirement |
| --- | --- |
| Firmware | Version 84.22.0.17 or later |
| Plan | Enterprise Plan (self-managed phone system) or Ultimate Plan (hosted phone system) |

## Limits

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

## How it works

Archiving to Amazon S3 has two halves: setting up AWS, then setting up Cloud Voice.

1. On AWS, prepare the account and storage:
   - An **IAM user** (IAM is AWS Identity and Access Management, the service that controls who can access your AWS resources) with full access to Amazon S3, plus an access key pair (an access key ID and a secret access key) that Cloud Voice uses to authenticate its upload requests.
   - An **S3 bucket** to hold the archived files.
2. In Cloud Voice, connect the two:
   - Add the S3 bucket as an archive server.
   - Create one or more tasks that archive your files to that bucket.

When a task runs, Cloud Voice authenticates to Amazon S3 with the IAM user's access key pair. Once AWS accepts the request, the selected files are uploaded to the target bucket.

## Step 1. Create an IAM user with full Amazon S3 access on AWS

1. Sign in to the [AWS Management Console](https://console.aws.amazon.com/).
2. Search for the **IAM** service at the top of the console, then choose **Users** to open the IAM users page.

   ![The AWS console search bar with the IAM service selected](/images/pbx/search-iam-service.png)

3. Create an IAM user and give it full access to Amazon S3.

   a. In the top-right corner, click **Create user**.

   
   ![Cloud Voice, the Create user button on the IAM users page](/images/pbx/create-iam-user-button.png)

   b. On the **Specify user details** page, type a recognizable name in the **User name** field, then click **Next**.

   
   ![Cloud Voice, entering a user name on the Specify user details page](/images/pbx/specify-iam-username.png)

   c. On the **Set permissions** page, grant the user full access to Amazon S3 buckets, then click **Next**.

   :::note
   You can grant permission by adding the user to an existing group, creating a new group, or attaching a permission policy directly to the user. The example below creates a new group with full Amazon S3 access and adds the user to it.
   :::

   
   ![Cloud Voice, granting full Amazon S3 access on the Set permissions page](/images/pbx/grant-amazon-s3-access.png)

   d. On the **Review and create** page, click **Create user**. The new user appears in the users list with full Amazon S3 access.

   
   ![Cloud Voice, the review page before creating the IAM user](/images/pbx/iam-user-created-success.png)

4. Create an access key for the IAM user.

   a. In the users list, click the user you just created to open its details page.

   
   ![Cloud Voice, selecting the new IAM user in the users list](/images/pbx/click-created-iam-user.png)

   b. In the **Summary** section, click **Create access key**.

   
   ![Cloud Voice, the Create access key control in the user summary](/images/pbx/iam-user-create-access-key.png)

   c. On the **Access key best practices & alternatives** page, select **Third-party service**, confirm the choice, then click **Next**.

   
   ![Cloud Voice, choosing Third-party service as the access key use case](/images/pbx/iam-third-party-service-permission.png)

   d. On the **Set description tag - optional** page, add a description if you like, then click **Create access key**.

   
   ![Cloud Voice, adding an optional description tag for the access key](/images/pbx/iam-create-access-key.png)

   e. On the **Retrieve access keys** page, copy and save the **Access key** and **Secret access key** values, then click **Done**. The access key now appears in the user's access key list.

   :::caution
   The **Secret access key** is displayed only once. Record it somewhere safe before you click **Done**: you cannot retrieve it again afterward. Clicking **Download .csv file** to save a copy of the credentials is the recommended approach.
   :::

   ![Downloading the credentials as a .csv file](/images/pbx/download-csv-file-iam.png)

   
   ![Cloud Voice, the Retrieve access keys page showing the key pair](/images/pbx/retrieve-access-key.png)

## Step 2. Create an Amazon S3 bucket on AWS

1. In the AWS Management Console, search for the **S3** service in the top search bar, then choose **Buckets**.

   ![The AWS console search bar with the S3 service selected](/images/pbx/search-s3-service.png)

2. In the top-right corner, choose the region where you want to create the bucket.

   :::note
   Pick the region closest to your phone system server to reduce latency and cost, and to meet any data-residency requirements.
   :::

   
   ![Cloud Voice, selecting an AWS region in the S3 console](/images/pbx/amazon-select-region.png)

3. Create the bucket.

   a. On the right side of the page, click **Create bucket**.

   
   ![Cloud Voice, the Create bucket button in the S3 console](/images/pbx/create-bucket-button.png)

   b. Confirm the region and enter a name for the bucket.

   - **AWS Region**: Prefilled with the region you selected.
   - **Bucket name**: A recognizable name for the bucket.

   ![Setting the region and name for a new S3 bucket](/images/pbx/set-up-s3-bucket.png)

   c. Adjust any other settings to suit your needs.

   d. At the bottom of the page, click **Create bucket**. The bucket appears in the buckets list.

   ![The new bucket listed after creation](/images/pbx/s3-bucket-created-success.png)

   :::note
   To keep your archived files organized in Amazon S3, create folders inside the bucket. You can then point a task at a specific folder in the steps that follow.
   :::

   
   ![Cloud Voice, creating a folder inside an S3 bucket](/images/pbx/aws-create-folder.png)

## Step 3. Add the S3 bucket as an archive server in Cloud Voice

1. In the Cloud Voice admin portal, go to **System > Archive**.
2. On the **Archive Task** tab, click **Archive Server**.

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

3. Register the S3 bucket as an archive server.

   a. Click **Add**.

   b. In the dialog, fill in the following fields.

   ![The archive server dialog for an S3 server](/images/pbx/s3-archive-server-setting.png)

   | Setting | Description |
   | --- | --- |
   | Name | A recognizable name for the server. |
   | Server Type | Select **S3**. |
   | Region & Endpoint | Enter the AWS region of your bucket and its Amazon S3 endpoint, including the protocol (for example, `https://`). |
   | Access Key ID | Enter the access key ID you obtained from AWS. |
   | Secret Access Key | Enter the secret access key you obtained from AWS. |

   :::tip
   For the supported regions and their standard endpoints, see the Amazon S3 regional endpoints reference in the AWS documentation.
   :::

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

4. Click the close icon (![Close icon](/images/pbx/close-window.png)) to close the window.

## Step 4. Create a task to archive files to Amazon S3

1. On the **Archive Task** tab, click **Add**.
2. In the **Task Configuration** section, complete the basic settings.

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

   | Setting | Description |
   | --- | --- |
   | Name | A recognizable name for the task. |
   | File Type | Select **Recording Files** or **Backup Files**. |
   | Data Range | The time range of files to archive. You can archive up to 31 days of files per task. |
   | Sync Frequency | How often the task runs (see below). |
   | Recording File Format | The download format for recording files. Available only when archiving recording files; all recordings in the system are downloaded and archived in the format you choose. |

   **Sync Frequency** options:

   - **Once**: Archives the files immediately after you save the task.
   - **Daily**: Choose a time; the task runs at that time every day.
   - **Weekly**: Choose a day of the week and a time; the task runs then each week.
   - **Monthly**: Choose a day of the month and a time; the task runs then each month.

   :::note
   Large transfers consume CPU on your phone system. Schedule archive tasks for off-peak hours where possible.
   :::

3. In the **Storage Configuration** section, choose the archive server and set the storage options.

   | Setting | Description |
   | --- | --- |
   | Archive Server | Select the Amazon S3 bucket you added in Step 3. |
   | Select Folder/Path | Choose the bucket or folder where the files should be stored. |
   | Storage Method | How files are laid out on the server (see below). |
   | Skip archived files | Optional. Whether to skip files that were already archived. Available only for recording files. |
   | Delete local files after archiving | Optional. Whether to remove local copies once archiving completes. Available only for recording files. |
   | Organize Files by Date | Optional. Whether to group archived files into date-based subfolders. |

   **Storage Method** for a one-time task (Sync Frequency set to **Once**):

   - **Create Task Folder**: Creates a folder named `FileType-TaskName` under the selected path and stores the files inside it.
   - **Save Directly to Selected Path**: Saves the files to the selected path without creating a folder.

   **Storage Method** for a recurring task (Daily, Weekly, or Monthly):

   - **Create Folder per Execution**: Creates a folder named `FileType-TaskName-ExecutionDate` under the selected path on each run and stores that run's files inside it.
   - **Create Task Folder Once and Reuse It**: Creates a folder named `FileType-TaskName` under the selected path on the first run, then reuses it for later runs.
   - **Save Directly to Selected Path**: Stores files directly in the selected path on every run, without creating a folder.

   **Skip archived files** behavior:

   - Enabled: Files that were already archived are not archived again.
   - Disabled: Files are archived even if a copy was archived before. The file's storage location is updated, but the earlier copy is not deleted from the third-party server.

   **Delete local files after archiving** behavior:

   - Enabled: Local copies are deleted once archiving finishes. The recordings can still be played and downloaded from the admin portal and the Cloud Voice App, but are no longer available for playback or download on the third-party server or in Dynamics 365.
   - Disabled: Local files are kept after archiving.

   **Organize Files by Date** behavior:

   - Enabled: The system creates date-based subfolders under the storage path, named in `YYYYMMDD` format (for example, `20260301`).
   - Disabled: Files are saved directly to the storage path, with no date grouping.

   :::note
   When **Organize Files by Date** is enabled and the selected time range contains only one record, no date subfolder is created, the file is stored directly in the specified path.
   :::

4. Optional: set a retention policy for the archived files.

   :::note
   Retention settings are available only for recurring tasks. Make sure the IAM account has permission to DELETE resources on the archive server.
   :::

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

   | Setting | Description |
   | --- | --- |
   | Retention Type | How archived files are kept (see below). |
   | Retention Limit | The maximum number of files/folders, or the maximum number of days, depending on the retention type. |
   | Retention Unit | Whether the limit applies to folders or individual files (see below). |

   **Retention Type** options:

   - **Retention by Quantity**: Keeps files or folders up to a maximum count. Enter the count in **Retention Limit (files/folders)**. When the count is exceeded, the system automatically deletes the oldest items.
   - **Retention by Days**: Keeps files or folders up to a maximum age. Enter the number of days in **Retention Limit (in days)**. Items older than the limit are automatically deleted.

   :::note
   For **Retention by Days**, the age is measured from the time a file was archived on the server, not from when it was created on your phone system. It is counted in exact 24-hour periods rather than calendar days.
   :::

   **Retention Unit** options:

   - **Folder**: Applies to the task folders created on the archive server. This is available only when **Storage Method** is set to **Create Folder per Execution**, and it does not include the date-based subfolders produced by **Organize Files by Date**.
   - **File**: Applies to the individual files archived on the server.

5. Click **Save**.

## Verify the result

The selected files are uploaded to the target bucket or folder in Amazon S3, immediately for a one-time task, or at the scheduled time for a recurring one.

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

You can confirm the outcome in two places.

**In Cloud Voice**

Go to **System > Archive > Archival Logs**. When the task's **Result** column shows **Succeeded**, the files reached Amazon S3.

![The archival logs showing a succeeded task](/images/pbx/archival-logs.png)

:::note
If a task fails, the **Failed to Archive File(s)** event is triggered. Click the retry icon (![Retry icon](/images/pbx/Restore.png)) to run the task again.
:::

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

**In AWS**

In the AWS Management Console, open the S3 bucket you created. If the files are listed there, the archive succeeded.

![Cloud Voice, archived backup files listed in the S3 bucket](/images/pbx/backup-file-on-aws.png)
