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}
1 Like
Hello, what is the command you used to do the backup? also show the output of pbm status please
1 Like
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
1 Like
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=
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”
1 Like
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 e.g. mongodb://username:password@host:port/?options
1 Like
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
1 Like
@Simeon_Zaharici yes, they shouldn’t contain db part, for authorization use ?authSource=
instead
2 Likes
That was it, it works fine with the correct connection string 
Thanks a lot!
дуже дякую!
2 Likes