Slight problem restoring a V4 collection to a V6 server

Dear friends,
I have installed a new 6.0.6 MongoDB on Debian 11 on prem.
While restoring a db/collection, the documents get restored but I also get an error regarding the indexes of the original collection:

2023-05-13T16:40:14.778+0000    restoring indexes for collection memaback.issues from metadata
2023-05-13T16:40:14.778+0000    index: &idx.IndexDocument{Options:primitive.M{"name":"dateIssISO_1", "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"dateIssISO", Value:1}}, PartialFilterExpression:primitive.D(nil)}
2023-05-13T16:40:14.778+0000    index: &idx.IndexDocument{Options:primitive.M{"name":"issueid_-1", "unique":true, "v":2}, Key:primitive.D{primitive.E{Key:"issueid", Value:-1}}, PartialFilterExpression:primitive.D(nil)}
2023-05-13T16:40:14.778+0000            run create Index command for indexes: dateIssISO_1, issueid_-1

what is this saying exactly? I do remember about the existance of an index for those two keys but don’t remember the index type/details (and am bedridden with COVID without an access to a Compass client).
Thanks a lot

Hi @Robert_Alexander

The dump/restore should be completed on matching major versions of MongoDB, this could be why you are seeing this issue creating indexes.

You could:

  • You may be able to examine the metadata file in the dump and use that to recreating the indexes manually.
  • Restore to a matching 4.0 server, then upgrade through 4.2, 4.2, 5.0, 6.0 then dump/restore.
  • Try a mongoexport / mongoimport.
1 Like

Well actually it seems I just needed to recreate those indexes manually and all is fine. Thanks a lot