git - Would directly copying a mongodb database causes problems? -


we push our project git , mongodb data files in committed directories.

we found when pull project onto machine, failed insert document collection. however, if drop collection , recreate collection same name, insertion success. why failed insert , why succeed again recreate collection?

i new mongodb, need help. thanks.

provided cleanly shutdown mongod in question, copying contents of --dbpath not problem. actually, considered valid practice backup purposes.

when copying files of running instance, copying lock files , journaling data deleted during clean shutdown. may prevent write access collections.

when delete collection, metafiles reset , of course can insert then.

so have do:

  1. shut down first instance cleanly
  2. add, commit , push contents of dbpath
  3. restart first instance
  4. shutdown target instance if running
  5. pull data
  6. restart target instance

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -