Page tree
Skip to end of metadata
Go to start of metadata

As Docker containers are light virtual machines, data cannot be manipulayed outside the container containing them. A consequence is  : If the service docker is stopped, all data are erased !

Check this guide for backup and restoration of files and databases.

In all cases, backup are produced on the same machine where data is stored. It is your responsibility to back up these files on an other machine/external drives/etc by using some tools like rsync.


Manage files

The directory paths referenced in your configuration.sh are folders instantly and automatically mapped into the running containers, meaning that stopping Docker does not delete these files. However, it is recommended to make regular backups to avoid issues in case of machine failure. In particular, these folders contain important data:

DirectoryExplanation
IMS_STORAGE_PATHall images
BACKUP_PATHautomatic database backups
RETRIEVAL_PATHretrieval data. If not saved, all data need to be re-indexed and can slow down Cytomine.
SOFTWARE_DOCKER_IMAGES_PATHsoftware execution environments. If not saved, all software need to be re-downloaded and can slow down Cytomine.
SERVER_SSHKEYS_PATHCytomine SSH keys to communicate with distant processing servers
FAST_DATA_PATHimages that need a fast storage (e.g. HDF5)


If the Docker service is down, when we will restart the containers, they will be mapped on theses folders and get all these files.

Manage PostgreSQL database

The PostgreSQL is the main database of Cytomine.

Backup database

An automatic rotating backup is done during the night if BACKUP_BOOL is true is the configuration.sh file in the bootstrap directory. The backup are stored in the BACKUP_PATH folder.

If you want to make a manual backup of the PostgreSQL database, run

sudo docker exec -it db pg_dump -h localhost -U docker -f /tmp/manualBackupPostgis.sql docker

A password is needed. By default the password is docker.

Then, copy the resulting file on your machine on a given DEST_PATH.

sudo docker cp db:/tmp/manualBackupPostgis.sql DEST_PATH

Restore database

If you want to make a restore of a backup (automatic or manual) from a backup file at location BACKUP_FILE mapped into the backup_postgis container, run

cd Cytomine-bootstrap
sudo sh auto_backup/restore_postgis.sh BACKUP_FILE
sudo sh restart_keep_data.sh

Manage MongoDB database

The MongoDB database stores all information regarding Cytomine usage (user connections, user positions, annotation selections, time spent on images, ...) mainly when Cytomine is used in educational purposes.

Backup database

An automatic rotating backup is done during the night if BACKUP_BOOL is true is the configuration.sh file in the bootstrap directory. The backup are stored in the BACKUP_PATH folder.

If you want to make a manual backup of the MongoDB database, run

sudo docker exec -it mongodb mongodump -h localhost -U docker -o /tmp/manualBackupMongo

Then, copy the resulting file on your machine on a given DEST_PATH.

sudo docker cp mongodb:/tmpo/manualBackupMongo DEST_PATH

Restore database

If you want to make a restore of a backup (automatic or manual) from a backup file at location BACKUP_FILE mapped into the backup_mongo container (e.g/ /backup/cytomine_database/manualBackupMongo/ ), run

cd Cytomine-bootstrap
sudo docker exec -it backup_mongo mongorestore -h db BACKUP_FILE
sudo sh restart_keep_data.sh
  • No labels