If the database is internal (i.e. using the postgres container as the backend database), you could make use of the scripts under the docker-swarm/bin folder for the backup and restore.
Backing up your data
Start HUB as database migrate mode:
docker stack rm hub docker stack deploy -c docker-compose.dbmigrate.yml hubRun the following command:
./hub_create_data_dump.sh /pathtodbdumpYou will have the following files under
/pathtodbdumpafter the script completes:bds_hub.dumpglobals.sql
Restoring your data
You must first delete the existing hub_postgres96-data-volume before you can restore your database. Use the following command to do so:
STACK=${STACK:-hub} -- change the "hub" part to match your actual deployment
docker volume rm ${STACK}_postgres96-data-volumeOnce you have deleted the existing volume, you can restore your database by following these steps:
Start a brand new HUB as database migrate mode and then use
hub_db_migrate.shto restore the data:docker stack deploy -c docker-compose.dbmigrate.yml hub ./hub_db_migrate.sh /pathtodbdumpAnd finally, start HUB normally:
docker stack rm hub docker stack deploy -c docker-compose.yml -c sizes-gen04/120sph.yaml -c docker-compose.local-overrides.yml hubThe resource definition file used above can be changed to better fit your scanning patterns and usage. See the Distribution section for a list of all available options. Please note the system requirements for each option as they increase with greater resource definitions.
If the database is external, please contact your database administrator for the data backup.