Backup & Restore
Production environments should regularly backup Zadig system data. In the event of database failure, Kubernetes cluster failure, or other extreme situations, you can refer to this manual for quick recovery or migration of Zadig.
# Data Backup
# Database
# MongoDB Data
Backup the databases: zadig, plutus_zadig.
If a database name was specified during installation, use the database name provided in the installation parameters.
mongodump -h IP --port port -u username -p password -d zadig -o file path
mongodump -h IP --port port -u username -p password -d plutus_zadig -o file path
1
2
2
# MySQL Data
Backup the databases: user, dex.
mysqldump -h <HOST> -P <PORT> -u root -p user > user.sql
mysqldump -h <HOST> -P <PORT> -u root -p dex > dex.sql
1
2
2
# Built-in MinIO Object Storage
- Install the MinIO client tool mc(opens new window)
- Execute backup commands:
export NAMESPACE=<Zadig Namespace>
kubectl port-forward svc/kr-minio -n <Zadig Namespace> 9000:9000
mc alias set zadig-minio http://localhost:9000 AKIAIOSFODNN72019EXAMPLE wJalrXUtnFEMI2019K7MDENGbPxRfiCYEXAMPLEKEY
mc mirror zadig-minio/bucket/ ./bucket/
1
2
3
4
2
3
4
# Installation Parameters
helm get values <Zadig Release Name> -n <Zadig Namespace> > zadig.yaml
1
# Data Recovery
# Data Import
# MongoDB Data
If a database name was specified during installation, use the database name provided in the installation parameters.
mongorestore -h IP --port port -u username -p password -d zadig --drop file path
mongorestore -h IP --port port -u username -p password -d plutus_zadig --drop file path
1
2
2
# MySQL Data
# Perform the following operations in MySQL:
mysql> drop database user;
mysql> create database user;
mysql> drop database dex;
mysql> create database dex;
# Execute the following data recovery command in the command line:
mysql -h <HOST> -P <PORT> -u root -p user < user.sql
mysql -h <HOST> -P <PORT> -u root -p dex < dex.sql
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# MinIO Data
kubectl port-forward svc/kr-minio -n <Zadig namespace> 9000:9000
mc alias set zadig-minio http://localhost:9000 AKIAIOSFODNN72019EXAMPLE wJalrXUtnFEMI2019K7MDENGbPxRfiCYEXAMPLEKEY
mc mirror ./bucket/ zadig-minio/bucket/
1
2
3
2
3
# Reinstall Zadig
To ensure the license remains valid, do not change the cluster or Namespace when reinstalling.
Reference: Install Zadig.


