docker-db-backup
docker-db-backup copied to clipboard
URI for mongorestore
Description of the feature
We have possibility to use uri parameter for mongodump
, but not for mongorestore
Benftits of feature ${MONGO_CUSTOM_URI} for mongodump
Additional context In usr/local/bin/restore add:
if [ -n "${MONGO_CUSTOM_URI}" ] ; then
mongo_backup_parameter="--uri=${MONGO_CUSTOM_URI}"
else
mongo_backup_parameter="-d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass}"
fi
In usr/local/bin/restore change:
mongorestore ${mongo_compression} -d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename}
--->
mongorestore ${mongo_compression} ${mongo_backup_parameter} --archive=${r_filename}