0

As the title implies, I need to copy db from ec2 instance with bitnami image that has mongodb pre-installed with version 3.0.9 , to new bitnami ec2 instance that has mongodb version 3.6.8 pre-installed.

I first used:

db.copyDatabase("my_db", "my_db", "000.00.00.000", "root", "xxxxxxxxxx")

but then I received the following output:

{
"ok" : 0,
"errmsg" : "Server min and max wire version are incompatible (0,3) with client min wire version (6,6)"
}

Now, from what I understand, This messages is implying that mongo cannot copy the db since they are 2 different mongo versions.

So from the 2 cent knowledge I have on this matter, I came to the understanding that I need to upgrade my first ec2 instance - mongodb(3.0.9) to be compatible with the mongo db I need to copy to i.e 3.6.8.

I have followed the set of instructions in the mongo docs here to gradually update to 3.2 and then 3.4 etc.. but I although I completed all instructions, my mongo db version remains 3.0.9

Im assuming that it is related to the bitnami infrastructure and the way they have there mongodb installed, but I cannot point to the problem.

I am really stuck on this matter. (perhaps I don't need to upgrade mongo db and there is a workaround etc.. because I am banging my head in the wall)

T.I.A

Hudi Ilfeld
  • 123
  • 6

1 Answers1

1

The conventional way is to dump the data from old mongodb instance (mongodump), then upgrade it's installation to a newer version, then import the data back from a logical dump (mongorestore).

Take a look at the official documentation about what tool should be used on each stage.

drookie
  • 8,051
  • 1
  • 17
  • 27