Sure @Fabio_Ramohitaj ,
So I am executing the below command to restore all the data and Indexes from production to stage database using the below command
nohup mongotools/mongodb-database-tools-rhel70-x86_64-100.8.0/bin/mongorestore mongodb+srv://<db_username>:<db_password>@dhb-stage-pl-0.a9242.mongodb.net/?appName=FF_STB --nsFrom PIMSPB.* --nsTo SIMSB.* --numParallelCollections=120 --numInsertionWorkersPerCollection=12 --gzip --dir /share/infa/Backup/mongo_export/PIMSPB_B/ --drop >> /share/infa/Backup/mongo_export/PIMSPB_B_log/SIMSB.log &
Then I have all my documents are restored successfully, the Index creation is failed with the below error.
Error: Failed: SIMSB.SSEGEB: error creating indexes for SIMSB.SSEGEB: create Index error: (DuplicateKey) Index build failed: a6754ab8-93a6-462d-9eca-5854e5819db9: Collection SIMSB.SSEGEB ( aa0b576b-5d8e-4b45-a1c7-0c1557d89ae6 ) :: caused by :: E11000 duplicate key error collection: SIMSB.SSEGEB index: ME_PART_NUMBER_1_SERIAL_NUMBER_1 dup key: { ME_PART_NUMBER: “09-7221-9-0006”, SERIAL_NUMBER: 5858 }
681134180 document(s) restored successfully. 0 document(s) failed to restore.
Can you please let me know if there is a way to restore only indexes.
Regards,
Dinesh S