cioos-siooc / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers datahub.io, catalog.data.gov and europeandataportal.eu/data/en/dataset among many other sites.
http://ckan.org/
Other
2 stars 4 forks source link

Backup restore volumes #130

Closed sjbruce closed 2 years ago

sjbruce commented 2 years ago

Adding docker volume backup and restore scripts to complement database backup script.

Backup: Usage: backup_ckan_volumes.sh [LOCAL_BACKUP_PATH] [CKAN_CONTAINER] [TEMP_CONTAINER_IMAGE]

Example: bash backup_ckan_volumes.sh ~/ckan_backup ckan ubuntu

The backup script will create a YYYY-MM-DD named directory to deposit 3 .tar files inside, one for the relevant contents of each volume.

NOTE: This does not backup the entire volume, merely the parts that are directly applicable to the CKAN install.

The source directories that are extracted are listed below and located near the top of the backup script:

CKAN_HOME_PATH="/usr/lib/ckan/venv/src"
CKAN_CONFIG_PATH="/etc/ckan"
CKAN_STORAGE_PATH="/var/lib/ckan/storage"

Restore: Usage: restore_ckan_volumes.sh [LOCAL_BACKUP_PATH] [BACKUP_TAG] [CKAN_CONTAINER] [TEMP_CONTAINER_IMAGE]

Example: bash restore_ckan_volumes.sh 2021-10-26 ~/ckan_backup ckan ubuntu

The restore script will reference the sub-directory created by the backup script as the "BACKUP_TAG", it is assumed to be a child of the "LOCAL_BACKUP_PATH".

The .tar files that were created by the backup script will be extracted into the root of the source volume.

github-actions[bot] commented 2 years ago

Image has been pushed to cioos/ckan

Testing Quick Start

Pull image

sudo docker pull cioos/ckan:PR130 or sudo CKAN_TAG=PR130 docker-compose pull ckan

Remove Home Volume and Restart

sudo docker-compose down
sudo docker volume rm docker_ckan_home
sudo CKAN_TAG=PR130 docker-compose up -d

for full documentation see TBD