Search code examples
mongodbpymongomongodump

MongoDB db files movement


I am using mongodb and I have changed the dbpath. Can I just copy all the files from the earlier dbpath to the new dbpath?

PS: I have come across the mongodump alternative which might be a bit tedious. So I am interested in knwoing whether plain copying work?


Solution

  • Yes, you can just do a normal copy if you shutdown your mongod first. You don't need to copy mongod.lock.