Hi Team,
I have dropped a collection from my TestDB (from both Stage and Prod Server), and I wanted to restore it back using OplogReplay by taking backup of oplog.rs collection. But it is throwing the below error.
Can you please help?
Note: I am using AKS cluster.
Syntax:
mongorestore --host=xxxxxxxx --port 27017 --oplogReplay --oplogLimit 1644392307 --authenticationDatabase admin -u xxxxxx -p xxxx /var/lib/mongodb/local/oplog.rs.bson
Stage Server Error:
Failed: restore error: error applying oplog: applyOps: (Unauthorized) not authorized on admin to execute command { applyOps: [ { ts: Timestamp(1641288700, 2), t: 1, h: null, v: 2, op: “c”, ns: “config.$cmd”, o: { create: “system.indexBuilds”, idIndex: { v: 2, key: { _id: 1 }, name: “id” } } } ], lsid: { id: UUID(“a3a053a6-ef03-44e9-ad18-69d44040f577”) }, $clusterTime: { clusterTime: Timestamp(1644407312, 1), signature: { hash: BinData(0, 5219E1B914EF211962681D46B336D3864642C59F), keyId: 7049281289794355202 } }, $db: “admin”, $readPreference: { mode: “primaryPreferred” } }
2022-02-09T11:48:32.786+0000 0 document(s) restored successfully. 0 document(s) failed to restore.
Production Server Error: