# Can I put bucket path instead of bucket name in backup

**URL:** <https://forums.percona.com/t/can-i-put-bucket-path-instead-of-bucket-name-in-backup/36539>\
**Category:** Percona Backup for MongoDB\
**Tags:** mongodb\
**Created:** [February 5, 2025, 5:46am UTC](https://forums.percona.com/t/can-i-put-bucket-path-instead-of-bucket-name-in-backup/36539 "2025-02-05T05:46:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya1523](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aditya1523/32/20039_2.png) [@Aditya1523](https://forums.percona.com/u/Aditya1523)\
**Post date:** [February 5, 2025, 5:46am UTC](https://forums.percona.com/t/can-i-put-bucket-path-instead-of-bucket-name-in-backup/36539/1 "2025-02-05T05:46:35Z")

</div>

Hi, I have deployed **Percona Server for MongoDB** on Kubernetes and am using the following code for backups. However, I’m encountering an error during the backup process when i am giving bucket path. When I use a simple bucket name like **`mongodb-backup`** , the backup works fine.

 ![Screenshot 2025-02-05 at 11.15.41 AM](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/e/4/e49ce91107eba3ed5a7e9f375f51a85ec1591acb.png)

Is it possible to specify a **bucket path** instead of just the bucket name? If so, could you provide an example of how to configure it correctly?

````auto
storages:
      mongo-daily-backup:
        s3:
          bucket: devops/integration/mongodb/mongo-daily-backup
          credentialsSecret: mongodb-mongo-db-secrets-c8b7f20e
          endpointUrl: https://4b949bcf987231b504ca149.r2.cloudflarestorage.com
          region: us-east-1
        type: s3```
````

---

<div class="post-metadata">

**Author:** ![fabien.hannecart](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fabien.hannecart/32/18835_2.png) [@fabien.hannecart](https://forums.percona.com/u/fabien.hannecart)\
**Post date:** [February 5, 2025, 9:49am UTC](https://forums.percona.com/t/can-i-put-bucket-path-instead-of-bucket-name-in-backup/36539/2 "2025-02-05T09:49:56Z")

</div>

Hello @Aditya1523

I don’t know if this can help you but I had an identical problem to yours at the beginning. I gave:

- `endpointUrl` in the format `https://xxxx-mongo-backup-logical.s3.fr-par.xxx.xxxx`
- `bucket` in the format `directory/xxx/yyyy`

Afterwards I understood that it was necessary to do :

- `endpointUrl` different `https://s3.fr-par.xxx.xxxx`
- `bucket` in the format `xxxxx-mongo-backup-logical`

In the end here is the format that currently works :

```auto
...
  storages:
    s3-xxx-fr-par-logical:
      type: s3
      s3:
        region: "fr-par"
        bucket: "xxxx-mongo-backup-logical"
        endpointUrl: "https://s3.fr-par.xxx.xxxx"
        credentialsSecret: pbm-mongo-backup-s3
        uploadPartSize: 268435456
...

```

Note that: `bucket` for me is a name/ID of bucket, but not a name of directory in bucket  
And after in my bucket i have backup by date is directory :

 ![Capture d’écran du 2025-02-05 10-53-26](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/3X/f/8/f844a7b5c653770021be9eaae5227331ad31a24c.png)

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [February 5, 2025, 11:38am UTC](https://forums.percona.com/t/can-i-put-bucket-path-instead-of-bucket-name-in-backup/36539/3 "2025-02-05T11:38:05Z")

</div>

Hi, you can use the [prefix option](https://docs.percona.com/percona-operator-for-mongodb/operator.html#backupstoragesstorage-names3prefix) of the crd to specify the path inside the bucket.
