# Data storage and backup
# Docker-compose
# Backup and restore in a simple installation
In the context of a simple installation, data within Ontopic Studio is stored in Docker named volumes.
For Ontopic Studio to function properly, it's essential to back up the ./env
and ./default-secrets
folders in addition to the named volumes. These named volumes include:
studio_docs
studio_repos
studio_store-db
studio_git-config
studio_git-data
studio_git-mirror-db
studio_identity-data
# Backup procedure with Docker Desktop
To ensure data integrity and facilitate backup, the official Docker Desktop extension known as "volumes Backup & Share" can be utilized. You can find this extension on Docker Hub at Docker Volumes Backup & Share Extension (opens new window).
This extension offers several options for exporting and importing volumes:
- Export as a compressed file on your local filesystem.
- Export to a local image.
- Export to an image in Docker Hub or another container registry.
# Backup procedure on a server setting
On a server-based setup, data backup can be achieved by following these steps:
- Halt the containers that rely on the specific volume you wish to back up. (You can use
docker compose -f docker-compose.yml -f tutorial/docker-compose-tutorial.yml down
). - Create a backup of the volume's directory, which is typically located at
/var/lib/docker/volumes/<volume-name>
.
Alternatively, you can use a backup script such as the one provided at GitHub (opens new window).
# Backup and restore in an advanced installation
In an advanced installation of Ontopic Studio (initiated using the init-configuration-local.sh
script before launching Ontopic Studio for the first time) data from the containers is stored in bind mounts. By default, this data is saved in a folder named ./volumes
, while configuration secrets are stored in ./default-secrets
.
To back up the necessary data for Ontopic Studio:
- Stop Ontopic Studio. (use
docker compose -f docker-compose.yml -f tutorial/docker-compose-tutorial.yml down
). - Back up the following directories:
./env
,./volumes
, and./default-secrets
.
For restoration:
- Ensure that Ontopic Studio is not running.
- Clear the contents of the
./volumes
directory. - Insert the backup data.
- Start Ontopic Studio using
docker compose -f docker-compose.yml -f tutorial/docker-compose-tutorial.yml up
.
# Volumes and default positions
Within Ontopic Studio, various directories serve specific purposes, and these directories are defined by environment variables. These include:
STORE_SERVER_DOCS_DIR=./volumes/docs
: This directory stores the LevelDB database used to support multisync and contains the actual Ontopic project data.STORE_SERVER_REPOS_DIR=./volumes/repos
: This directory holds a local copy of the Git repository.STORE_SERVER_DB_DATA_DIR=./volumes/store-db
: In this directory, you'll find the database containing permission settings, along with projects and their data source connections. This database can be either Postgres or SQLite, depending on your configuration.GIT_MIRROR_CONFIG_DIR=./volumes/git-config
: This directory serves as the configuration folder for Gitea, used to define various settings for Gitea, such as server configuration, database connections, authentication methods, and more.GIT_MIRROR_DATA_DIR=./volumes/git-data
: This directory is the data storage location for Gitea, containing various data, including Git repositories, user avatars, attachments, and other assets used by Gitea. It stores the actual repository data and user-generated content.GIT_MIRROR_DB_DATA_DIR=./volumes/git-mirror-db
: This directory contains the Gitea Postgres database.IDENTITY_SERVICE_DATA_DIR=./volumes/identity-service
: This directory is used for storing session data related to the identity service and authentication. It doesn't need to be backup, it is used simply as a cache.
# Manual backup of your projects
Alternatively, you can export your Ontopic Studio Projects for backup clicking on the button export project on the Dashboard. If it is necessary, you can reimport your project, creating a new project with the data source connection and clicking on the button import project on the Dashboard.
# AWS Marketplace
Create a snapshot of the second volume (/dev/xvdba
).