MongoDb dump needs to restore on percona mongoDB with encrypation

Hi I have installed percona mongodb with vault.
Now I have a normal backup of mongodb and now I need to restore normal db to percona mongodb with enable encryption.

Can any one help me on this.

1 Like

Hi @vijendra

When you mean vault, I’m assuming you are referencing using vault to store the Master Key for Data at Rest Encryption.

If your target MongoDB already has it enabled(Data at Rest Encryption) you can simply restore the data; If it’s a mongodump backup.

In the following example, I have an encrypted node:
{"t":{"$date":"2021-08-13T20:00:08.367-03:00"},"s":"I", "c":"STORAGE", "id":29039, "ctx":"initandlisten","msg":"Encryption keys DB is initialized successfully"}

Them, I’m going to restore my backup via mongorestore, which is was created normally from mongodump:

**mongorestore** -h localhost --port 4460 -uadmin -psekret --authenticationDatabase admin /mydump/
|2021-08-13T20:15:12.635-0300|preparing collections to restore from|
|---|---|
|2021-08-13T20:15:12.635-0300|reading metadata for percona.date from /mydump/percona/date.metadata.json|
|2021-08-13T20:15:12.648-0300|restoring percona.date from /mydump/percona/date.bson|
|2021-08-13T20:15:13.413-0300|finished restoring percona.date (100000 documents, 0 failures)|
|2021-08-13T20:15:13.413-0300|no indexes to restore for collection percona.date|
|2021-08-13T20:15:13.413-0300|100000 document(s) restored successfully. 0 document(s) failed to restore.|

Let me know if that clarified your question.
Otherwise, feel free to provide further details.

Best,

Jean da Silva

1 Like