Hi @vinicius.grippa ,
I have tried below thing but doesn’t seems to be working for Pitr.
#------------ Below is the current status of collection :
singlereplica [direct: primary] claranet> db.sos_dba.find()
[
{ _id: ObjectId("63da0f7cfcffefb815ba7287"), Sector: 'Redis DBA' },
{ _id: ObjectId("63da0f84fcffefb815ba7288"), Sector: 'MongoDB DBA' },
{ _id: ObjectId("63da0f89fcffefb815ba7289"), Sector: 'MySQL DBA' }
]
#------------- Now I take the physical backup using PBM
CMD :
root@DESKTOP-L0E2A77:~# pbm config --set pitr.enabled=true --mongodb-uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlereplica"
[pitr.enabled=true]
root@DESKTOP-L0E2A77:~# pbm backup --type=physical --mongodb-uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlerepl
ica"
Starting backup '2023-02-01T07:38:18Z'...
Backup '2023-02-01T07:38:18Z' to remote store '/root/backup' has started
Logs :
2023-02-01T13:08:19.000+0530 I [backup/2023-02-01T07:38:18Z] backup started
2023-02-01T13:08:20.000+0530 D [backup/2023-02-01T07:38:18Z] backup cursor id: 2f8cfdec-8868-4856-9bd2-3248eb431f40
2023-02-01T13:08:21.000+0530 I [pitr] created chunk 2023-02-01T07:37:34 - 2023-02-01T07:38:19
2023-02-01T13:08:21.000+0530 I [pitr] pausing/stopping with last_ts 2023-02-01 07:38:19 +0000 UTC
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] set journal up to {1675237100 1}
2023-02-01T13:08:23.000+0530 I [backup/2023-02-01T07:38:18Z] uploading files
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/journal/WiredTigerLog.0000000069 100.00MB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/WiredTigerHS.wt 84.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/_mdb_catalog.wt 44.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-0--1065177456980969369.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-0--2476177255030375037.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-0--4107819621118277074.wt 52.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-0-6141969711064962041.wt 44.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-0-9045027585385083941.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-10--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-12--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-14--4107819621118277074.wt 6.27MB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-15--4107819621118277074.wt 24.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-17--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-19--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-2--1065177456980969369.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-2--2476177255030375037.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-2-5751740019876761316.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-22--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-24--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-26--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-27--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-28--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-29--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-35--4107819621118277074.wt 4.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-38--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-41--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-47--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-49--4107819621118277074.wt 260.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-5--2476177255030375037.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-5--7400535609859724419.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-5-4811384220244075947.wt 24.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-51--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-54--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-57--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-60--4107819621118277074.wt 40.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-64--4107819621118277074.wt 44.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-68--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-7--2476177255030375037.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-70--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/collection-8--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-1--1065177456980969369.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-1--2476177255030375037.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-1--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-1-6141969711064962041.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-1-9045027585385083941.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-11--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-13--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-16--4107819621118277074.wt 24.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-18--4107819621118277074.wt 20.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-20--4107819621118277074.wt 36.00KB
2023-02-01T13:08:23.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-21--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-23--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-25--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-3--1065177456980969369.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-3--2476177255030375037.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-3-5751740019876761316.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-30--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-31--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-32--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-33--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-34--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-36--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-37--4107819621118277074.wt 4.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-39--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-4--2476177255030375037.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-40--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-42--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-43--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-48--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-50--4107819621118277074.wt 100.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-52--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-53--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-55--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-56--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-58--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-59--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-6--2476177255030375037.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-6--7400535609859724419.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-6-4811384220244075947.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-61--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-62--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-63--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-65--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-66--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-67--4107819621118277074.wt 36.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-69--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-71--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-8--2476177255030375037.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/index-9--4107819621118277074.wt 20.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/sizeStorer.wt 44.00KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/WiredTiger.backup 157.23KB
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/WiredTiger 50.00B
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] uploading: /var/lib/mongodb/journal/WiredTigerLog.0000000070 100.00MB
2023-02-01T13:08:24.000+0530 I [backup/2023-02-01T07:38:18Z] uploading done
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] stop cursor polling: <nil>, cursor err: <nil>
2023-02-01T13:08:24.000+0530 D [backup/2023-02-01T07:38:18Z] epoch set to {1675237104 46}
2023-02-01T13:08:26.000+0530 I [backup/2023-02-01T07:38:18Z] backup finished
2023-02-01T13:08:26.000+0530 D [backup/2023-02-01T07:38:18Z] releasing lock
2023-02-01T13:08:34.000+0530 D [pitr] start_catchup [oplog only]
2023-02-01T13:08:34.000+0530 D [pitr] lastTS set to {1675237099 6} 2023-02-01T07:38:19
2023-02-01T13:08:34.000+0530 I [pitr] streaming started from 2023-02-01 07:38:19 +0000 UTC / 1675237099
2023-02-01T13:08:34.000+0530 D [pitr] start_ok
2023-02-01T13:13:36.000+0530 I [pitr] created chunk 2023-02-01T07:38:19 - 2023-02-01T07:43:34. Next chunk creation scheduled to begin at ~2023-02-01T13:18:34
2023-02-01T13:18:36.000+0530 I [pitr] created chunk 2023-02-01T07:43:34 - 2023-02-01T07:48:34. Next chunk creation scheduled to begin at ~2023-02-01T13:23:34
2023-02-01T13:21:49.000+0530 I [pitr] got done signal, stopping
2023-02-01T13:21:51.000+0530 I [pitr] created chunk 2023-02-01T07:48:34 - 2023-02-01T07:51:49
2023-02-01T13:21:51.000+0530 I [pitr] pausing/stopping with last_ts 2023-02-01 07:51:49 +0000 UTC
Logs2 :
root@DESKTOP-L0E2A77:~# pbm list --mongodb-uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlereplica"
Backup snapshots:
2023-01-31T11:46:26Z <physical> [restore_to_time: 2023-01-31T11:46:29Z]
2023-02-01T07:38:18Z <physical> [restore_to_time: 2023-02-01T07:38:20Z]
PITR <on>:
root@DESKTOP-L0E2A77:~# pbm status --mongodb-uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlereplica"
Cluster:
========
singlereplica:
- singlereplica/127.0.0.1:27017 [P]: pbm-agent v2.0.2 OK
PITR incremental backup:
========================
Status [ON]
Currently running:
==================
(none)
Backups:
========
FS /root/backup
Snapshots:
2023-02-01T07:38:18Z 2.58MB <physical> [restore_to_time: 2023-02-01T07:38:20Z]
2023-02-01T06:26:32Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2023-02-01T07:08:01Z]
2023-01-31T11:46:26Z 2.37MB <physical> [restore_to_time: 2023-01-31T11:46:29Z]
2023-01-31T07:21:07Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2023-01-31T10:53:14Z]
2023-01-31T06:29:51Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2023-01-31T06:51:33Z]
2023-01-27T07:20:43Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2023-01-27T08:05:03Z]
2023-01-27T06:15:38Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2023-01-27T06:39:15Z]
2022-12-19T08:56:35Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2022-12-21T08:23:15Z]
2022-12-15T08:27:43Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2022-12-19T08:56:36Z]
2022-12-14T12:47:10Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2022-12-15T08:27:44Z]
2022-12-14T12:38:32Z 0.00B <physical> [ERROR: some of pbm-agents were lost during the backup] [2022-12-14T12:47:11Z]
PITR chunks [23.61KB]:
2023-02-01T07:38:21Z - 2023-02-01T07:48:34Z
2023-02-01T07:37:34Z - 2023-02-01T07:38:20Z (no base snapshot)
Note : I can see the Oplog slice in PBM status cmd but not in PBM list cmd.
#------------- Now I take the logical backup of admin schema for PBM metadata to restore it fresh machine.
root@DESKTOP-L0E2A77:~# mongodump --db=admin --uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlereplica" --out=/root/backup/dump_admin/
2023-02-01T13:22:13.051+0530 writing admin.system.users to /root/backup/dump_admin/admin/system.users.bson
2023-02-01T13:22:13.053+0530 done dumping admin.system.users (1 document)
2023-02-01T13:22:13.054+0530 writing admin.system.roles to /root/backup/dump_admin/admin/system.roles.bson
2023-02-01T13:22:13.055+0530 done dumping admin.system.roles (1 document)
2023-02-01T13:22:13.056+0530 writing admin.system.version to /root/backup/dump_admin/admin/system.version.bson
2023-02-01T13:22:13.058+0530 done dumping admin.system.version (2 documents)
2023-02-01T13:22:13.059+0530 writing admin.pbmLog to /root/backup/dump_admin/admin/pbmLog.bson
2023-02-01T13:22:13.060+0530 writing admin.pbmCmd to /root/backup/dump_admin/admin/pbmCmd.bson
2023-02-01T13:22:13.061+0530 writing admin.pbmOpLog to /root/backup/dump_admin/admin/pbmOpLog.bson
2023-02-01T13:22:13.061+0530 writing admin.pbmRestores to /root/backup/dump_admin/admin/pbmRestores.bson
2023-02-01T13:22:13.063+0530 done dumping admin.pbmCmd (70 documents)
2023-02-01T13:22:13.063+0530 writing admin.pbmBackups to /root/backup/dump_admin/admin/pbmBackups.bson
2023-02-01T13:22:13.063+0530 done dumping admin.pbmOpLog (63 documents)
2023-02-01T13:22:13.064+0530 done dumping admin.pbmRestores (24 documents)
2023-02-01T13:22:13.064+0530 writing admin.pbmPITRChunks to /root/backup/dump_admin/admin/pbmPITRChunks.bson
2023-02-01T13:22:13.064+0530 writing admin.pbmConfig to /root/backup/dump_admin/admin/pbmConfig.bson
2023-02-01T13:22:13.065+0530 done dumping admin.pbmPITRChunks (4 documents)
2023-02-01T13:22:13.066+0530 done dumping admin.pbmConfig (1 document)
2023-02-01T13:22:13.066+0530 done dumping admin.pbmBackups (11 documents)
2023-02-01T13:22:13.067+0530 writing admin.pbmLockOp to /root/backup/dump_admin/admin/pbmLockOp.bson
2023-02-01T13:22:13.067+0530 writing admin.pbmLock to /root/backup/dump_admin/admin/pbmLock.bson
2023-02-01T13:22:13.067+0530 writing admin.pbmAgents to /root/backup/dump_admin/admin/pbmAgents.bson
2023-02-01T13:22:13.068+0530 done dumping admin.pbmLockOp (0 documents)
2023-02-01T13:22:13.068+0530 done dumping admin.pbmLock (0 documents)
2023-02-01T13:22:13.068+0530 done dumping admin.pbmAgents (1 document)
2023-02-01T13:22:13.073+0530 done dumping admin.pbmLog (3400 documents)
#----------- Meanwhile I have inserted one record in collection between 07:38 - 07:48. So, after physical backup it’s recored in pitr oplog slice for point in time recovery after restore
singlereplica [direct: primary] claranet> db.sos_dba.insertOne({'Sector':'PostgreSQL DBA'})
{
acknowledged: true,
insertedId: ObjectId("63da188efcffefb815ba728a")
}
singlereplica [direct: primary] claranet> db.sos_dba.find()
[
{ _id: ObjectId("63da0f7cfcffefb815ba7287"), Sector: 'Redis DBA' },
{ _id: ObjectId("63da0f84fcffefb815ba7288"), Sector: 'MongoDB DBA' },
{ _id: ObjectId("63da0f89fcffefb815ba7289"), Sector: 'MySQL DBA' },
{
_id: ObjectId("63da188efcffefb815ba728a"),
Sector: 'PostgreSQL DBA'
}
]
#------- So, Now I intentionally do crash & start fresh instance:
root@DESKTOP-L0E2A77:~# service mongod stop
* Stopping database mongod [ OK ]
root@DESKTOP-L0E2A77:~# rm -rf /var/lib/mongodb/*
root@DESKTOP-L0E2A77:~# service mongod start
* Starting database mongod [ OK ]
root@DESKTOP-L0E2A77:~# mongosh
Current Mongosh Log ID: 63da1a5c23b2ef6a8ca3271d
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.6.1
Using MongoDB: 6.0.3-2
Using Mongosh: 1.6.1
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
------
The server generated these startup warnings when booting
2023-02-01T13:22:53.092+05:30: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
2023-02-01T13:22:53.321+05:30: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted. You can use percona-server-mongodb-enable-auth.sh to fix it
2023-02-01T13:22:53.321+05:30: vm.max_map_count is too low
------
------
Enable MongoDB's free cloud-based monitoring service, which will then receive and display
metrics about your deployment (disk utilization, CPU, operation statistics, etc).
The monitoring data will be available on a MongoDB website with a unique URL accessible to you
and anyone you share the URL with. MongoDB may use this information to make product
improvements and to suggest MongoDB products and deployment options to you.
To enable free monitoring, run the following command: db.enableFreeMonitoring()
To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
------
test> rs.initiate()
{
info2: 'no configuration specified. Using a default configuration for the set',
me: '127.0.0.1:27017',
ok: 1
}
#---------- Now to avail for PBM metadata I restore admin schema using mongodump
root@DESKTOP-L0E2A77:~# mongorestore /root/backup/dump_admin/
2023-02-01T13:24:35.684+0530 preparing collections to restore from
2023-02-01T13:24:35.686+0530 reading metadata for admin.pbmAgents from /root/backup/dump_admin/admin/pbmAgents.metadata.json
2023-02-01T13:24:35.686+0530 reading metadata for admin.pbmCmd from /root/backup/dump_admin/admin/pbmCmd.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmLock from /root/backup/dump_admin/admin/pbmLock.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmPITRChunks from /root/backup/dump_admin/admin/pbmPITRChunks.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmRestores from /root/backup/dump_admin/admin/pbmRestores.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmBackups from /root/backup/dump_admin/admin/pbmBackups.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmConfig from /root/backup/dump_admin/admin/pbmConfig.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmLockOp from /root/backup/dump_admin/admin/pbmLockOp.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmLog from /root/backup/dump_admin/admin/pbmLog.metadata.json
2023-02-01T13:24:35.687+0530 reading metadata for admin.pbmOpLog from /root/backup/dump_admin/admin/pbmOpLog.metadata.json
2023-02-01T13:24:35.813+0530 restoring admin.pbmRestores from /root/backup/dump_admin/admin/pbmRestores.bson
2023-02-01T13:24:35.860+0530 finished restoring admin.pbmRestores (24 documents, 0 failures)
2023-02-01T13:24:35.860+0530 restoring admin.pbmLog from /root/backup/dump_admin/admin/pbmLog.bson
2023-02-01T13:24:35.860+0530 restoring admin.pbmBackups from /root/backup/dump_admin/admin/pbmBackups.bson
2023-02-01T13:24:35.860+0530 restoring admin.pbmOpLog from /root/backup/dump_admin/admin/pbmOpLog.bson
2023-02-01T13:24:35.892+0530 finished restoring admin.pbmBackups (11 documents, 0 failures)
2023-02-01T13:24:35.897+0530 finished restoring admin.pbmOpLog (63 documents, 0 failures)
2023-02-01T13:24:35.897+0530 restoring admin.pbmCmd from /root/backup/dump_admin/admin/pbmCmd.bson
2023-02-01T13:24:35.955+0530 finished restoring admin.pbmCmd (70 documents, 0 failures)
2023-02-01T13:24:35.956+0530 restoring admin.pbmPITRChunks from /root/backup/dump_admin/admin/pbmPITRChunks.bson
2023-02-01T13:24:35.956+0530 restoring admin.pbmConfig from /root/backup/dump_admin/admin/pbmConfig.bson
2023-02-01T13:24:35.991+0530 finished restoring admin.pbmConfig (1 document, 0 failures)
2023-02-01T13:24:35.996+0530 finished restoring admin.pbmPITRChunks (4 documents, 0 failures)
2023-02-01T13:24:35.996+0530 restoring admin.pbmAgents from /root/backup/dump_admin/admin/pbmAgents.bson
2023-02-01T13:24:36.053+0530 restoring admin.pbmLockOp from /root/backup/dump_admin/admin/pbmLockOp.bson
2023-02-01T13:24:36.053+0530 finished restoring admin.pbmAgents (1 document, 0 failures)
2023-02-01T13:24:36.054+0530 restoring admin.pbmLock from /root/backup/dump_admin/admin/pbmLock.bson
2023-02-01T13:24:36.070+0530 finished restoring admin.pbmLock (0 documents, 0 failures)
2023-02-01T13:24:36.073+0530 finished restoring admin.pbmLockOp (0 documents, 0 failures)
2023-02-01T13:24:36.092+0530 finished restoring admin.pbmLog (3400 documents, 0 failures)
2023-02-01T13:24:36.092+0530 restoring users from /root/backup/dump_admin/admin/system.users.bson
2023-02-01T13:24:36.134+0530 restoring roles from /root/backup/dump_admin/admin/system.roles.bson
2023-02-01T13:24:36.277+0530 restoring indexes for collection admin.pbmLock from metadata
2023-02-01T13:24:36.277+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"replset_1", "sparse":true, "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"replset", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.277+0530 restoring indexes for collection admin.pbmPITRChunks from metadata
2023-02-01T13:24:36.277+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"rs_1_start_ts_1_end_ts_1", "sparse":true, "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"rs", Value:1}, primitive.E{Key:"start_ts", Value:1}, primitive.E{Key:"end_ts", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.277+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"start_ts_1_end_ts_1", "v":2}, Key:primitive.D{primitive.E{Key:"start_ts", Value:1}, primitive.E{Key:"end_ts", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.277+0530 no indexes to restore for collection admin.pbmConfig
2023-02-01T13:24:36.277+0530 restoring indexes for collection admin.pbmOpLog from metadata
2023-02-01T13:24:36.277+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"opid_1_replset_1", "sparse":true, "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"opid", Value:1}, primitive.E{Key:"replset", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.277+0530 restoring indexes for collection admin.pbmLockOp from metadata
2023-02-01T13:24:36.277+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"replset_1_type_1", "sparse":true, "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"replset", Value:1}, primitive.E{Key:"type", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.298+0530 no indexes to restore for collection admin.pbmAgents
2023-02-01T13:24:36.298+0530 no indexes to restore for collection admin.pbmCmd
2023-02-01T13:24:36.298+0530 no indexes to restore for collection admin.pbmRestores
2023-02-01T13:24:36.298+0530 restoring indexes for collection admin.pbmBackups from metadata
2023-02-01T13:24:36.298+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"name_1", "sparse":true, "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"name", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.298+0530 index: &idx.IndexDocument{Options:primitive.M{"name":"start_ts_1_status_1", "v":2}, Key:primitive.D{primitive.E{Key:"start_ts", Value:1}, primitive.E{Key:"status", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-02-01T13:24:36.479+0530 no indexes to restore for collection admin.pbmLog
2023-02-01T13:24:36.550+0530 3574 document(s) restored successfully. 0 document(s) failed to restore.
#-------- Backup is listed in pbm list
root@DESKTOP-L0E2A77:~# pbm list --mongodb-uri="mongodb://pbmuser:secretpwd@localhost:27017/?authSource=admin&replicaSet=singlereplica"
Backup snapshots:
2023-02-01T07:38:18Z <physical> [restore_to_time: 2023-02-01T07:38:20Z]
PITR <on>: