Elma365-Backupper is a utility that allows for backup of BRIX application data.
Backup of BRIX should include:
- PostgreSQL. The database stores the main system data: users, application items, application settings, workspaces, processes, pages, widgets, tasks, events, and other configuration settings.
- MongoDB. This database contains unstructured system settings, chat data, and activity streams.
- S3 Object Storage. The object storage holds uploaded and created files in BRIX of any type and size, such as documents, photographs, audio, and video files.
Начало внимание
When creating a backup copy, the BRIX services are stopped, and the application itself becomes unavailable.
Конец внимание
The process of database backup and recovery consists of four steps:
Step 1: Install elma365-Backupper
- Install the packages:
sudo apt install -y apt-transport-https ca-certificates curl
- Import the keys:
sudo curl -fsSL https://repo.elma365.tech/deb/elma365-keyring.gpg | gpg --dearmor > /etc/apt/trusted.gpg.d/elma365-keyring.gpg
- Add the BRIX repository:
echo "deb [arch=amd64] https://repo.elma365.tech/deb $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/elma365.list
sudo apt update
- Install elma365-Backupper:
sudo apt install elma365-backupper
Installation for Red Hat-like operating systems
| 
 cat <<EOF | sudo tee /etc/yum.repos.d/elma365.repo   
 dnf install elma365-backupper | 
Step 2: Configure elma365-Backupper
- Open configuration file /opt/elma365/backupper/etc/config:
nano /opt/elma365/backupper/etc/config
- In the opened window, fill out the parameters:
- KUBECONFIGis the path to the kubeconfig file, used for selecting the Kubernetes cluster and connecting to the Kubernetes API server. If not specified,- $HOME/.kube/configis used by default.
- BACKUP_DSTis the directory where the backup will be saved. Available options are:
- filesystemis backup is saved to the local file system at the path specified in- BACKUP_PATH.
- s3is backup is saved to an S3 storage, using settings specified in parameters- S3_BUCKET_NAME,- S3_HOST,- S3_PORT,- S3_ROOT_USER,- S3_ROOT_PASSWORD,- S3_SSL_ENABLED.
- K8S_NS_DBSis the namespace where the BRIX application is installed.
- K8S_NS_APPis the namespace where the built-in databases are installed, set up in the Kubernetes cluster. For more information, see Prepare embedded databases.
Ensure ports 7000, 7001, 7002 are available for port forwarding to access databases in the Kubernetes cluster. If necessary, ports can be overridden in S3_SRC_PORT, PG_SRC_PORT, MONGO_SRC_PORT.
- BACKUP_LIFEis the period in days for storing backup copies. Copies older than this value will be deleted during the next backup.
- TMP_DIRis the directory for storing temporary backups. There should be enough space for one backup. The backup is assembled in this directory before being moved to the storage location specified in- BACKUP_DST.
|   | 
Step 3: Database backup
Perform a backup of the BRIX application databases:
elma365-backupper backup <<db-type>>
Where <<db-type>> is the name of the database for which you want to perform the backup. The possible values for the argument are:
- mongofor MongoDB.
- postgresfor PostgreSQL.
- s3for S3 storage.
- allfor all databases (MongoDB, PostgreSQL, S3).
Additional backup command keys
| 
 Example of the command:   
 Example of the command:   | 
Step 4: Database recovery
You can restore databases from the latest or a specific version of the backup.
Начало внимание
Before restoring data from a backup, clear the databases and S3 storage or use the --cleanup-databases key.
Конец внимание
For more details on how to prepare databases for restoration, refer to the following articles: PostgreSQL and MongoDB.
Restoration from the latest backup
Execute the command:
elma365-backupper restore <<db-type>>
Where <<db-type>> is the name of the database for which you need to retrieve the list of backups. The argument values can be:
- mongofor MongoDB.
- postgresfor PostgreSQL.
- s3for S3 storage.
- allfor all databases (MongoDB, PostgreSQL, S3).
With this command, you can restore databases to the latest backup found in the storage.
Restoration from a specific backup
- Get the list of backups from the storage:
elma365-backupper backup-list <<db-type>>
Where <<db-type>>  is the name of the database for which you need to retrieve the list of backups. The argument values can be:
- mongofor MongoDB.
- postgresfor PostgreSQL.
- s3for S3 storage.
- allfor all databases (MongoDB, PostgreSQL, S3).
Additional keys for the backup-list command
| 
 Example of the command:   
 Example of the command:   | 
Depending on the backup storage method indicated in the BACKUP_DST parameter, the backup-list command will return:
- For s3: names of directories with dumps in S3 storage.
- For filesystem: absolute paths to directories with dumps in the file system.
- Execute database restoration from a specific backup:
elma365-backupper restore <<db-type>> --backup-path /path/to/backup
The backup for database restoration is taken from the storage specified in the BACKUP_DST parameter:
- If S3 storage is indicated:
elma365-backupper restore <<db-type>> --backup-path ELMA365_YYYY.MM.DD-HH.MI.SS
- If a local directory is indicated:
elma365-backupper restore <<db-type>> --backup-path /opt/elma365/backupper/backup/ELMA365_YYYY.MM.DD-HH.MI.SS/
Additional keys for the restore command
| 
 Example of the command:   
 Example of the command:   | 
Found a typo? Select it and press Ctrl+Enter to send us feedback