Using the latest JFrog products?
JFrog Platform User Guide
JFrog Mission Control 3.x Documentation
To get the latest version, go to the JFrog Unified Platform
Docker Backup and Recovery
For an installation of Mission Control as a Docker image, data and configuration files are stored under the $MC_HOME
folder (whose default location is $HOME/.jfrog/jfmc
).
To enable fully functional recovery following a failure in Mission Control, you need to back up all content in this folder.
Backing Up Data on the Source Machine
Mission Control uses three databases, PostgreSQL , ElasticSearch and MongoDB (removed in 3.4.x). In the default installation process, these are installed by Mission Control and are fully dedicated to its use. In such a default installation, Mission Control will store its data in $MC_HOME (usually $HOME/.jfrog/jfmc
).
Backing up external databases
The detailed instructions below show how to back up the MC_HOME folder. The code snippets provided assume that you have used the default location for this folder which is $HOME/.jfrog/jfmc
Stop the services
./mission-control stop
Take a snapshot of the Mission Control folder with an appropriate name. Any archive tool can be used for this purpose. Our example shows how this is done using tar.
Doing daily backups?
If you are backing up on a daily basis, we suggest using the current date as a postfix to the archive name to uniquely identify it.
Navigate to the parent directory of $MC_HOME and archive only its content
cd ~/.jfrog tar -cf mission-control-<date>.tar jfmc
Restoring on the Target Machine
Preparing the Target Machine
To be able to restore a backup, you need to have a corresponding target installation of Mission Control (of the same version as your source instance) ready to go with the corresponding folder structure in place to receive files backed up from the source. Note that if you upgrade your source installation of Mission Control, you will need to repeat this preparation process to upgrade the target installation to the same new version. We strongly recommend having a target machine prepared and ready to receive a backup at all times. To prepare a target machine, follow the steps below:
Install the same version of Mission Control that you have running on the source machine. For details, please refer to Installing Mission Control.
./mission-control install
Using external databases
If you externalized any of the databases in your source Mission Control installation, you need to have corresponding databases ready in the target installation. When installing the target installation, make sure to specify the external databases that will used for recovery.
Start and stop the services. This will create the folder structure needed to restore files backed up from the source
./mission-control start ./mission-control stop
Restoring a Backup
To restore a backup from the source machine, follow the steps below on the target machine
Copy the archive that was backed up on the source machine to the parent folder of $MC_HOME on the target machine.
Replace current $MC_HOME directory with $MC_HOME directory of the backed-up source machine,
Navigate to the parent directory of $MC_HOME and extract its content,cd ~/.jfrog mv jfmc jfmc_backup (can be removed once this process successfully completes) tar -xf mission-control-<date>.tar
Using external databases
If you are using external databases on the source machine, make sure to back them up, and restore them to corresponding databases on the target machine.
Start the services,
./mission-control start
Update Mission Control base url,
Credentials of local admin of mission control should be used.
curl '<jfmc-base-url>/api/v3/settings/base_url' -i -u 'admin:password' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"base_url" : "<jfmc-base-url>"}'
Linux Backup and Recovery
For non-Docker distributions, Mission Control's data is distributed (by default) among the following folders:
Mission Control services | /var/opt/jfrog/mission-control |
PostgreSQL | /var/opt/jfrog/postgres/data |
MongoDB | /var/lib/mongodb (removed in 3.4.x) |
ElasticSearch | /var/lib/elasticsearch |
Backing Up Data on the Source Machine
To run a backup, you need to create a snapshot of each of the data folders described in the previous section. Note that the Mission Control data folder is located at $MC_DATA which by default is /var/opt/jfrog/mission-control
.
On the source machine, follow the steps below:
Stop the services,
/opt/jfrog/mission-control/scripts/jfmc.sh stop
Take a snapshot of the Mission Control data and database folders with an appropriate name. Any archive tool can be used for this purpose. Our example shows how this is done using tar.
Doing daily backups?
If you are backing up on a daily basis, we suggest using the current date as a postfix to the archive name to uniquely identify it.
Navigate to the parent folder of $MC_DATA and archive only its content,
cd /var/opt/jfrog tar -cf mission-control-<date>.tar mission-control cd /var/lib In an rpm installation, tar -cf jfmc-mongo-<date>.tar mongo In a Debian installation, tar -cf jfmc-mongodb-<date>.tar mongodb cd /var/opt/jfrog tar -cf jfmc-postgres-<date>.tar postgres tar -cf jfmc-elasticsearch-<date>.tar elasticsearch
Restoring on the Target Machine
Preparing the Target Machine
To be able to restore a backup, you need to have a corresponding target installation of Mission Control (of the same version as your source instance) ready to go with the corresponding folder structure in place to receive files backed up from the source. Note that if you upgrade your source installation of Mission Control, you will need to repeat this preparation process to upgrade the target installation to the same new version. We strongly recommend having a target machine prepared and ready to receive a backup at all times. To prepare a target machine, follow the steps below:
Install the same version of Mission Control that you have running on the source machine. For details, please refer to Installing Mission Control.
./installJFMC-<install_type>.sh install
Using external databases
If you externalized any of the databases in your source Mission Control installation, you need to have corresponding databases ready in the target installation. When installing the target installation, make sure to specify the external databases that will used for recovery.
Start and stop the services. This will create the folder structure needed to restore files backed up from the source
/opt/jfrog/mission-control/scripts/jfmc.sh start /opt/jfrog/mission-control/scripts/jfmc.sh stop
Restoring a Backup
Copy the archives backed up from the source machine to the corresponding parent folders in the target machine (
/var/opt/jfrog
and/var/lib
by default)Replace current data directories on the target with its corresponding data directories from the source machine,
Navigate to the parent folder of $MC_DATA and extract its content,cd /var/opt/jfrog mv mission-control mission-control_backup (can be removed once this process successfully completes) tar -xf mission-control.tar chown -R jfrogmc:jfrogmc mission-control cd /var/lib In rpm installation, mv mongo mongo_backup (can be removed once this process successfully completes) tar -xf jfmc-mongo-<date>.tar chown -R mongod:mongod mongo setenforce 0 In deb installation, mv mongodb mongodb_backup (can be removed once this process successfully completes) tar -xf jfmc-mongodb-<date>.tar chown -R mongodb:mongodb mongodb cd /var/opt/jfrog tar -xf jfmc-postgres-<date>.tar chown -R postgres:postgres postgres mv elasticsearch elasticsearch_backup (can be removed once this process successfully completes) tar -xf jfmc-elasticsearch-<date>.tar chown -R elasticsearch:elasticsearch elasticsearch
Start the services,
/opt/jfrog/mission-control/scripts/jfmc.sh start
Update Mission Control base URL,
Admin credentials
You will need to provide Mission Control Admin credentials to perform this action.
curl '<jfmc-base-url>/api/v3/settings/base_url' -i -u 'admin:password' -X PUT -H 'Content-Type: application/json; charset=UTF-8' -d '{"base_url" : "<jfmc-base-url>"}'