Hello everyone,
I’m running some tests with MongoDB 4.4 on an Oracle Linux 9.6 server and I’ve encountered an unexpected issue with database restore.
My goal is to test incremental backups, so I have configured my MongoDB server as a replica set standalone (single-node replicaset) in order to enable the oplog.
Here is the procedure I follow:
- I restore all databases from a single compressed archive file using the following command:
mongorestore --host localhost --port 27017 --username sysdba --password *** \
--authenticationDatabase admin --gzip --archive=/path/to/backup --drop
- I make some modifications to the data through Studio 3T.
- I run the same restore command again, expecting the database to return to its original state.
Problem:
After the second restore, I can still see the modifications I made after the backup was taken. The database does not revert to the previous state as expected, even though I am using --drop.
Details:
- The archive contains all databases at the time of backup.
- All collections are included (except the ones I created manually after the backup).
- I check the data exclusively through Studio 3T (not via the
mongoshell).
Has anyone experienced a similar issue with mongorestore on a replica set standalone configuration? Am I missing some important step to ensure the restore overwrites the existing data correctly?
Any advice would be greatly appreciated.
Thanks in advance!