docker-db-backup icon indicating copy to clipboard operation
docker-db-backup copied to clipboard

URI for mongorestore

Open Mark24Slides opened this issue 1 year ago • 0 comments

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}

Mark24Slides avatar Sep 21 '23 07:09 Mark24Slides