Closed alancwoo closed 3 years ago
The mongodb dump is generated with the following arguments:
--gzip --archive
You'll also need to ensure the database names match locally and remotely, as permissions are only set on the database matching the service name.
Hope that helps.
This helped enormously - and worked perfectly, thank you for the help @josegonzalez and everyone for Dokku
Description of problem
I am trying to use
mongorestore
to import a database exported via mongodump on my local dev machine to a dokku instance. I cannot seem to find a way to get this to work.How reproducible
Persistent
Steps to Reproduce
mongodump --db=DBNAME
dump
folder to dokku hostActual Results
https://github.com/dokku/dokku-mongo/issues/76#issuecomment-269868348 results in
error reading database: not authorized on APP_NAME_REDACTED to execute command
mongorestore --uri='DSN_VIA_MONGO_INFO'
hangs with no outputmongorestore --host=MONGO_INFO_INTERNAL_IP --port=MONGO_INFO_PORT --username=USERNAME_FROM_DSN --authenticationDatabase admin --db DB_NAME
fails withFailed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.
dokku mongo:import APP_NAME < ./dump/DB_NAME/COLLECTION.bson
fails of course,Failed: gzip: invalid header
Expected Results
Import completes successfully
Environment Information
dokku mongo:info APP_NAME
outputHow (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
CLI install