Skip to end of metadata
Go to start of metadata

Overview

As the centralized command and control center for all your services, we recommend maintaining a dormant copy of Mission Control that can quickly take over in case your main installation goes down for any reason. To facilitate rapid recovery capabilities, this page offers system backup procedures that keep your dormant copy updated in the background and ready to take over at a moment's notice. These procedures are based on frequently synchronizing Mission Control data and configuration files from your main Mission Control instance to your recovery instance during normal operation.

Make sure to maintain compatibility

To maintain the same level of accessibility and functionality on both the source and target instances of mission control, make sure that:
1. Installation, copy and other actions are done by the same user on both machines to keep the ownership and permissions intact
2. The same version of Mission Control is installed on both the source and target machines

The sections below describe the steps you need to take for backup and recovery of Docker and non-Docker (Linux) installations. The backup and recovery procedure is split up between actions you will take on the source machine when backing up data, and actions you will take on the target machines to restore one of the backed up datasets.

Page Contents

 


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

If you already have any of the three databases used by Mission Control already installed in your organization, during the installation process, you also have the option to "externalize" the databases which means you will direct Mission Control to use your previously installed databases.  For any database that you chose to externalize, it is your responsibility to back up the relevant data, and restore it later on in a corresponding database used by the target installation of Mission Control.

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

  1. Stop the services

    ./mission-control stop
  2. 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:

  1. 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.

  2.  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

  1. Copy the archive that was backed up on the source machine to the parent folder of $MC_HOME on the target machine.

  2. 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.

  3. Start the services,

    ./mission-control start
  4. 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:

  1. Stop the services,

    /opt/jfrog/mission-control/scripts/jfmc.sh stop
  2. 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:

  1. 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.

  2.  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

  1. 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)

  2. 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
  3. Start the services,

    /opt/jfrog/mission-control/scripts/jfmc.sh start
  4. 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>"}'
  • No labels