ubuntu - MongoDB Failed: can't create ActualPath object from path dump: stat dump: no such file or directory -
i have bunch of mongo databases need restore. used mongodump
backup directories, include collections inside of them. this:
|- mydir |-- db1 |--- collection1 |--- collections2 |-- db2 |--- collection1 |--- collections2
i cd
mydir
, mongorestore
, following error:
2016-07-25t10:41:12.378-0400 using default 'dump' directory 2016-07-25t10:41:12.378-0400 failed: can't create actualpath object path dump: stat dump: no such file or directory
then try restore specific database this: mongorestore db2
, following errors:
2016-07-25t10:47:04.413-0400 building list of dbs , collections restore db2 dir 2016-07-25t10:47:04.413-0400 don't know file "db2/collection1.bson", skipping... 2016-07-25t10:47:04.413-0400 don't know file "db2/collection1.metadata.json", skipping..."db2/collection2.bson", skipping... 2016-07-25t10:47:04.413-0400 don't know file "db2/collection2.metadata.json", skipping... 2016-07-25t10:47:04.414-0400 done
no matter or try, alternate between these 2 errors. , it's same of databases use.
i tried using --db
flag, -d
parameter, setting dump path third argument (mongorestore --db [db] [dump_path]
). found around stackoverflow. nothing.
i'm stuck on , have no idea how proceed.
edit
os: ubuntu 14.04
installed mongodb following guide:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
mongorestore
no dump_path positional argument expecting there folder named dump
in current working directory. if folder dump
not exist, "can't create actualpath..." error.
so if not have folder named dump, need pass positional argument. parent directory of mydir
run:
mongorestore mydir
if want use --db
option need specify dump path way down directory contains .bson files database or specific .bson file.
so example restore collections db1
:
mongorestore --db db1 ./db1
or restore collection1
:
mongorestore --db db1 ./db1/collection1.bson
Comments
Post a Comment