Copy the contents of /var/lib/mongodb
to /data/db
. The files you should be looking for should have names like your_db_name.ns
and your_dbname.n
where n
is a number starting with 0. If you do not see such files under /var/lib/mongodb
, search for them on your filesystem.
Once copied over, use --dbpath=/data/db
when starting MongoDB via the mongod
command.