Hi
I can access the files on dbpath and have already made a backup of those files on my local machine. Is there some way I can use these files to up another instance of mongodb?
Yes. You should be able to start up a new mongod
process by specifying the dbpath
directory to those copied data files. See Specify a Data Directory for details.
I tried creating an instance of mongodb on my local machine. I accessed the shell. Then replaced the files in dbpath with the files which I backed-up from server.
I doubt that this will work. From my understanding, you spin up a new mongod
, then replaced its dbpath
content. If you do this replacement while the server is running, it will put the database in an inconsistent state. If you do this replacement while the server is not running, then you’re overlaying the dbpath of two different deployments into one.
Instead of overwriting, it’s best if you specify mongod --dbpath <path_to_the_backup_dbpath>
.
“errmsg” : “unable to open cursor at URI statistics:table:collection-0—2640332284129588306. reason: No such file or directory”,
This error was caused by WiredTiger expecting for a file to exist, but it doesn’t. Could you check if your backup contains the file with a name such as collection-0--2640332284129588306.wt
? If not, then I’m afraid you have an incomplete backup. Unfortunately, if the incomplete backup or data corruption was caused by the hosting service, there’s very little any database can do to recover.
Best regards
Kevin