Restore mongo database from compose.io backup?

If you download the compose.io copy of the mongodb instance and unzip the .tar file, you get .ns and extensions, which are single digits. How do you restore db from them?

+7
mongodb restore compose
source share
1 answer

Files .ns.0.1 etc. data files themselves.

This is raw db, you can mongodump those files and then mongorestore, as always:

This solution will work pre mongo 3.0, but --dbpath is no longer supported on mongodump .

Mongo 3.0 solution:

  • Run mongod --dbpath ./ from the directory with the extracted boot with .ns files.
  • Run mongodump -d [DBNAME] -o [DIR TO DUMP TO] ... no parameters required.
  • Continue to use mongorestore as usual.
+9
source share

All Articles