# Problem with pbm restore - skipping restoring x.x, it is not included

**URL:** <https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543>\
**Category:** Percona Backup for MongoDB\
**Created:** [November 14, 2022, 9:06pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543 "2022-11-14T21:06:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simeon\_Zaharici](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/simeon_zaharici/32/8335_2.png) [@Simeon\_Zaharici](https://forums.percona.com/u/Simeon_Zaharici)\
**Post date:** [November 14, 2022, 9:06pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/1 "2022-11-14T21:06:45Z")

</div>

Hey guys,

I am doing a test restore using pbm 2.0.2 and it only restores the admin db on a MongoDB 6.0.2 sharded cluster.  
The backup seems to work correctly and it seems to include all the databases and collections.  
When I am doing the restore it completes successfully, however in the logs I see that dbs and collections are being skipped

> 2022-11-14T20:59:19.344+0000 archive format version “0.1”  
> 2022-11-14T20:59:19.344+0000 archive server version “6.0.2”  
> 2022-11-14T20:59:19.344+0000 archive tool version “2.0.2”  
> 2022-11-14T20:59:19.344+0000 setting number of parallel collections to number of parallel collections in archive (4)  
> 2022-11-14T20:59:19.356+0000 preparing collections to restore from  
> 2022-11-14T20:59:19.356+0000 skipping restoring kukta.kukta, it is not included

the restore command I run is

> pbm restore 2022-11-11T17:09:56Z --mongodb-uri=xxxx

Do you know what could cause this ?

Thanks

PS.  
I noticed this warning when the pbm agents are triggered:

> The --db and --collection flags are deprecated for this use-case; please use --nsInclude instead, i.e. with --nsInclude=${DATABASE}.${COLLECTION}

---

<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:** [November 15, 2022, 1:28pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/2 "2022-11-15T13:28:11Z")

</div>

Hello, what is the command you used to do the backup? also show the output of pbm status please

---

<div class="post-metadata">

**Author:** ![Simeon\_Zaharici](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/simeon_zaharici/32/8335_2.png) [@Simeon\_Zaharici](https://forums.percona.com/u/Simeon_Zaharici)\
**Post date:** [November 15, 2022, 3:18pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/3 "2022-11-15T15:18:39Z")

</div>

Hello,  
This is the pbm backup command

> pbm backup --mongodb-uri=mongos connection string

pbm status does not work

> pbm status --mongodb-uri=same mongos connection string as before  
> Error: get status of cluster: connect to `` [/]: create mongo client: error parsing uri: must have at least 1 host

pbm logs shows the backup has finished

> [backup/2022-11-15T14:44:03Z] backup finished

An important note that I should have included in the first post is that this cluster has been upgraded to mongo 6( all the way from 3.6 ) with pbm agents upgraded as well with 2.0.2 ( from 1.2.1) . Backup/Restores used to work fine before. The pbm collections were setup by the previous version of pbm.

Do you think I should erase all the pbm collections and re-apply the config ?

Thanks

---

<div class="post-metadata">

**Author:** ![Simeon\_Zaharici](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/simeon_zaharici/32/8335_2.png) [@Simeon\_Zaharici](https://forums.percona.com/u/Simeon_Zaharici)\
**Post date:** [November 15, 2022, 5:14pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/4 "2022-11-15T17:14:19Z")

</div>

My bad, actually pbm status works against individual members of the shardedcluster but not against the mongos uri.

bash-4.4$ pbm status --mongodb-uri=

```auto
Cluster:
========
shard01:
  - shard01/redacted:27017 [S]: pbm-agent v2.0.2 OK
  - shard01/redacted:27017 [S]: pbm-agent v2.0.2 OK
  - shard01/redacted:27017 [P]: pbm-agent v2.0.2 OK
shard02:
  - shard02/redacted:27017 [S]: pbm-agent v2.0.2 OK
 - shard02/redacted:27017 [S]: pbm-agent v2.0.2 OK
  - shard02/redacted:27017 [P]: pbm-agent v2.0.2 OK
csReplSet:
  - csReplSet/redacted:27017 [P]: pbm-agent v2.0.2 OK
  - csReplSet/redacted:27017 [S]: pbm-agent v2.0.2 OK
  - csReplSet/redacted:27017 [S]: pbm-agent v2.0.2 OK
shard03:
  - shard03/redacted:27017 [S]: pbm-agent v2.0.2 OK
  - shard03/redacted:27017 [P]: pbm-agent v2.0.2 OK
  - shard03/redacted:27017 [S]: pbm-agent v2.0.2 OK

PITR incremental backup:
========================
Status [OFF]

Currently running:
==================
(none)

Backups:
========
S3 ca-central-1 s3://<bucket>
  Snapshots:
    2022-11-15T16:42:28Z 1.67MB <logical> [restore_to_time: 2022-11-15T16:42:32Z]
    2022-11-15T14:44:03Z 10.28MB <logical> [restore_to_time: 2022-11-15T14:44:08Z]
    2022-11-14T18:57:24Z 10.26MB <logical> [restore_to_time: 2022-11-14T18:57:32Z]
    2022-11-14T15:30:09Z 24.46GB <logical> [restore_to_time: 2022-11-14T15:34:13Z]
    2022-11-14T15:06:42Z 24.46GB <logical> [restore_to_time: 2022-11-14T15:10:57Z]
    2022-11-11T17:09:56Z 24.47GB <logical> [restore_to_time: 2022-11-11T17:14:20Z]
  PITR chunks [1.62MB]:
    2022-11-14T15:10:58Z - 2022-11-14T18:13:55Z

```

I tried re-applying the config but the behaviour is the same, restore completes successfully but all the dbs and collections are “not included”

---

<div class="post-metadata">

**Author:** ![oleksandr.havryliak](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/oleksandr.havryliak/32/5703_2.png) [@oleksandr.havryliak](https://forums.percona.com/u/oleksandr.havryliak)\
**Post date:** [November 16, 2022, 6:31am UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/5 "2022-11-16T06:31:06Z")

</div>

Hi @Simeon_Zaharici !  
Look’s like your `mongodb_uri` contains db part e.g.: `mongodb://username:password@host:port/admin?options`  
But for PBM you need it without db part [as described in the documentation](https://docs.percona.com/percona-backup-mongodb/initial-setup.html#set-the-mongodb-connection-uri-for-pbm-agent) e.g. `mongodb://username:password@host:port/?options`

---

<div class="post-metadata">

**Author:** ![Simeon\_Zaharici](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/simeon_zaharici/32/8335_2.png) [@Simeon\_Zaharici](https://forums.percona.com/u/Simeon_Zaharici)\
**Post date:** [November 16, 2022, 1:45pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/6 "2022-11-16T13:45:46Z")

</div>

Thanks a lot, just to clarify so all the pbm-agent and pbm uris cli commands should not have the admin db  
Currently our pbm agents are configured as

> pbm-agent --mongodb-uri mongodb://pbmuser:XXXXXX@localhost:27017/admin

---

<div class="post-metadata">

**Author:** ![oleksandr.havryliak](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/oleksandr.havryliak/32/5703_2.png) [@oleksandr.havryliak](https://forums.percona.com/u/oleksandr.havryliak)\
**Post date:** [November 16, 2022, 1:54pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/7 "2022-11-16T13:54:30Z")

</div>

@Simeon_Zaharici yes, they shouldn’t contain db part, for authorization use `?authSource=` instead

---

<div class="post-metadata">

**Author:** ![Simeon\_Zaharici](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/simeon_zaharici/32/8335_2.png) [@Simeon\_Zaharici](https://forums.percona.com/u/Simeon_Zaharici)\
**Post date:** [November 16, 2022, 3:16pm UTC](https://forums.percona.com/t/problem-with-pbm-restore-skipping-restoring-x-x-it-is-not-included/18543/8 "2022-11-16T15:16:10Z")

</div>

That was it, it works fine with the correct connection string 🙂  
Thanks a lot!  
дуже дякую!
