---
title: "Backup Storage"
sidebar_label: "Backup Storage"
sidebar_position: 6
description: "How to create backup storage"
---

import TrashIcon from '@selectel/docux/icons/trash'
import Formbricks from '@theme/MDXComponents/Formbricks'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'
import EditIcon from '@selectel/docux/icons/edit'

# Backup Storage

By default, all backups are stored in a maintenance [Selectel S3](/s3/about/about-s3/) bucket. You can create a backup storage—an S3 bucket where you can save backups of an information base.

Using your own backup storage provides full access to backup files, allows you to configure replication to another pool, download backups, and migrate them to third-party infrastructure outside of Selectel.

You can manage backup storage in the [Control panel](https://my.selectel.ru/ones/backup/vaults) or via the [Cloud for 1C API](/api/1c-cloud/). See how to work with S3 in the [S3 product description](/s3/about/about-s3.mdx#working-with-s3).

## How it works \{#principle-of-operation}

You create backup storage based on an existing or new S3 bucket, after which you can save all new backups there.

S3 has a flat addressing structure — there are no folders or hierarchy in the storage, but for ease of use, you can create and view simulated folders (directories). A folder name is a prefix in an object name. When connecting a bucket, you can specify a prefix and configure saving backups to a simulated folder.

There are three ways to connect S3:

* [automatically](#create-automatically) — you can connect an existing bucket or create a new one. The service user and access policies for working with the bucket will be created automatically;
* [manually](#create-manually) — you can connect an existing bucket. You must create the service user and access policies yourself;
* [using API](/api/1c-cloud/) — you can connect a bucket from any project accessible to a service user with the S3 User role. You need to create the service user and access policies yourself.

### Bucket limitations and recommendations \{#bucket-limitations-and-recommendations}

You can only connect buckets with [Virtual-Hosted addressing](/s3/buckets/addressing-types.mdx#virtual-hosted) to backup storage. One bucket or simulated folder can be connected to only one storage in the selected pool and project.

The backup storage and the information database must be in the same pool. The S3 bucket can be in any pool.

For optimal performance, we recommend choosing buckets that are:

* private;
* in the [region](/infrastructure/locations.mdx#region) where the information database is located.

A bucket is connected to backup storage using a service user and bucket access policies. If the service user or bucket access policies are modified or deleted:

* backup storage will switch to the `ERRORED;` status;
* saving backups to storage will be unavailable;
* the backup plan will be disabled for all related information databases;
* downloading backups will only be available from S3.

## Pricing \{#price}

Storing files in a bucket is charged according to the [S3 payment model and prices](/s3/about/payment.mdx).

When an information base is deleted, backups in the associated bucket will be stored for another 30 days. When backup storage is deleted, backup files are not deleted and charges continue to apply; to stop billing, [delete the buckets](/s3/buckets/delete-bucket.mdx).

## Create backup storage automatically \{#create-automatically}

When creating storage, the following will be created and configured by default:

* service user `GO1C_SERVICE_USER`;
* access policy for the service user `GO1C_UPLOAD_BACKUP_POLICY`;
* access policy for the current user `ALL_OTHER`.

A user with the [role](/access-control/access-management.mdx#roles) of Account owner and users with the following role combinations can connect a bucket automatically:

* [`member`](/access-control/role-reference.mdx#member) in the Account access area and [`iam.admin`](/access-control/role-reference.mdx#iam-admin);
* [`member`](/access-control/role-reference.mdx#member) in the Project access area and [`iam.admin`](/access-control/role-reference.mdx#iam-admin).

<Tabs queryString="create-automatically">
  <TabItem value="new" default>
    <TabItemLabel>
      New bucket
    </TabItemLabel>

    1. In the [control panel](https://my.selectel.ru/ones/server), on the top menu, click **Products** and select **Managed 1C Cloud**.
    2. Go to the **Backups** section.
    3. Click **Create backup storage**.
    4. Select the [region and pool](/infrastructure/locations.mdx) where the backup storage will be created. The information database and backup storage pools must match.
    5. Select the storage creation method — **Automatically**.
    6. Select the [region and pool](/infrastructure/locations.mdx) where the bucket will be created. We recommend creating the bucket in the same region as the information database.
    7. In the **Bucket** field, select **New S3 bucket**. A private bucket with virtual-hosted addressing and a standard storage class will be created.
    8. In the **Bucket name** field, specify the name of the new bucket. For S3 API compatibility, the bucket name must be unique within S3 and comply with Amazon S3 bucket naming rules, see more in the [Bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) section of the Amazon documentation.
    9. In the **Prefix** field, specify a prefix for the emulated folder (directory) where backup files will be stored.

       If you need to create a new folder, specify its name according to Amazon S3 bucket naming rules. The folder will be created when you create the backup storage.

       If you want the backup files to be stored in the root of the bucket, leave the field empty.
    10. Click **Create**.
  </TabItem>

  <TabItem value="existing">
    <TabItemLabel>
      Existing bucket
    </TabItemLabel>

    1. Make sure the bucket complies with the [bucket limitations and recommendations](#bucket-limitations-and-recommendations).
    2. In the [control panel](https://my.selectel.ru/ones/server), on the top menu, click **Products** and select **Managed 1C Cloud**.
    3. Go to the **Backups** section.
    4. Click **Create backup storage**.
    5. Select the [region and pool](/infrastructure/locations.mdx) where the backup storage will be created. The information database and backup storage pools must match.
    6. Select the storage creation method — **Automatically**.
    7. Select the [region and pool](/infrastructure/locations.mdx) where the bucket is located.
    8. In the **Bucket** field, select a bucket from the list.
    9. In the **Prefix** field, specify a prefix for the emulated folder (directory) where backup files will be stored.

       If you need to create a new folder, specify its name according to Amazon S3 bucket naming rules. The folder will be created when you create the backup storage.

       If you want the backup files to be stored in the root of the bucket, leave the field empty.
    10. Click **Create**.
  </TabItem>
</Tabs>

## Create backup storage manually \{#create-manually}

1. [Prepare the bucket for connection](#set-up-bucket).
2. [Create backup storage](#create-backup-storage).

### 1. Prepare the bucket for connection \{#set-up-bucket}

<Tabs queryString="set-up-bucket">
  <TabItem value="new" default>
    <TabItemLabel>
      Create a new bucket
    </TabItemLabel>

    1. Make sure you are in the [project](/access-control/projects/about-projects.mdx) where the information database is located.

    2. [Create a service user](/access-control/manage/add-user.mdx#add-service-user) with the S3 User role and access to the project where the bucket will be created.

    3. [Create a bucket](/s3/buckets/create-bucket.mdx) in S3. Observe the [bucket limitations and recommendations](#bucket-limitations-and-recommendations).

    4. Open the page of the created bucket → **Bucket Policy** tab.

    5. Click **Create Bucket Policy**.

    6. [Add a rule](/s3/buckets/bucket-policy/create-policy.mdx#add-rule) for the service user:

       * in the **Access** field, select **Allow**;
       * in the **Users** field, select **Authorized** and add the service user you created in step 2;
       * in the **Action set** field, select **Editor**.

    7. [Add a rule](/s3/buckets/bucket-policy/create-policy.mdx#add-rule) for [users](/access-control/user-types.mdx#users):

       * in the **Access** field, select **Allow**;
       * in the **Users** field, select **Authorized** and add the user who will connect the storage to the 1C cluster;
       * in the **Action set** field, select **All**.

    8. Click **Save**.

    9. [Issue S3 keys](/access-control/manage/edit-user-data-or-role.mdx#manage-s3-keys)) to the service user.
  </TabItem>

  <TabItem value="existing">
    <TabItemLabel>
      Prepare an existing bucket
    </TabItemLabel>

    1. Make sure the bucket complies with the [bucket limitations and recommendations](#bucket-limitations-and-recommendations).

    2. Make sure you are in the [project](/access-control/projects/about-projects.mdx) where the information database and S3 bucket are located.

    3. [Create a service user](/access-control/manage/add-user.mdx#add-service-user) with the S3 User role and access to the project where the bucket is located.

    4. Go to the [S3](https://my.selectel.ru/storage/) section **S3** → **Buckets**.

    5. Open the page of the created bucket → **Bucket Policy** tab.

    6. Click **Create Bucket Policy**.

    7. [Add a rule](/s3/buckets/bucket-policy/create-policy.mdx#add-rule) for the service user:

       * in the **Access** field, select **Allow**;
       * in the **Users** field, select **Authorized** and add the service user you created in step 3;
       * in the **Action set** field, select **Editor**.

    8. [Add a rule](/s3/buckets/bucket-policy/create-policy.mdx#add-rule) for the user:

       * in the **Access** field, select **Allow**;
       * in the **Users** field, select **Authorized** and add the user who will connect the storage to the 1C cluster;
       * in the **Action set** field, select **All**.

    9. Click **Save**.

    10. [Issue S3 keys](/access-control/manage/edit-user-data-or-role.mdx#manage-s3-keys)) to the service user.
  </TabItem>
</Tabs>

### 2. Create backup storage \{#create-backup-storage}

1. In the [control panel](https://my.selectel.ru/ones/server), on the top menu, click **Products** and select **Managed 1C Cloud**.
2. Go to the **Backups** section.
3. Click **Create backup storage**.
4. Select the [region and pool](/infrastructure/locations.mdx) where the backup storage will be created. The information database and backup storage pools must match.
5. Select the storage creation method — **Manually**.
6. Select the region and the pool where the [bucket](#set-up-bucket) is located.
7. In the **Bucket** field, select the bucket that you [prepared earlier](#set-up-bucket).
8. In the **Prefix** field, specify a prefix for the emulated folder (directory) where the backups will be stored.

   If you need to create a new folder, specify its name in accordance with the Amazon S3 [bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). The folder will be created automatically when you create the backup storage.

   If backups are to be stored in the bucket root, leave the field empty.
9. In the **S3 keys** block, specify the **Access key** and **Secret key** for the service user you created when [preparing the bucket](#set-up-bucket).
10. Click **Create**.

<Formbricks />
