mongorestores behaving differently on different machines?

172 views Asked by At

I do the following:

mongorestore  -d connect connect

on my local machine and it works fine. On my development machine on amazon i get this output from the same command and the same database dump and the same version of mongodb (2.0.4):

don't know what to do with file [connect/connect/channels.metadata.json]
don't know what to do with file [connect/connect/movies.metadata.json]
Thu Dec 12 09:11:46 connect/connect/movies.bson
Thu Dec 12 09:11:46      going into namespace [connect.movies]
2667 objects found
Thu Dec 12 09:11:46 connect/connect/teams.bson
Thu Dec 12 09:11:46      going into namespace [connect.teams]
335 objects found
don't know what to do with file [connect/connect/broadcasts.metadata.json]
Thu Dec 12 09:11:46 connect/connect/channels.bson
Thu Dec 12 09:11:46      going into namespace [connect.channels]
82 objects found
don't know what to do with file [connect/connect/series.metadata.json]
Thu Dec 12 09:11:46 connect/connect/sportsevents.bson
Thu Dec 12 09:11:46      going into namespace [connect.sportsevents]
24 objects found

The data imported is not complete. What do i do wrong?

1

There are 1 answers

0
Stennie On

The metadata.json files are only created in MongoDB 2.2 or newer, so you definitely have a newer version of mongodump on your local machine than your development machine (2.0.4).

The metadata.json file includes useful information like index definitions and capped collection properties. If you try to restore using an older version of mongorestore, it won't know how to handle those files and so your restore will not be complete. If you are relying on newer features of MongoDB such as the Aggregation Framework, these also won't be available in MongoDB 2.0.x.

You should upgrade your development machine on AWS to match the version on your local machine. If you are using a 2.2.x or 2.4.x that isn't the latest production point release in that series, you should also upgrade your local machine at the same time.