Backup and restore¶
This topic provides guidance on the following actions:
Backing up Anaconda Server¶
Follow these steps to back up your instance of Anaconda Server:
Install
pg_dump
andpg_restore
.Run the following command from the install directory:
# Replace <POSTGRES_PASSWORD> with your postgres password. You can find your postgres password here: <BASE_INSTALL_DIR>/config/postgres/postgres_db_password.txt ./repo-tools backup --database-uri postgresql://postgres:<POSTGRES_PASSWORD>@localhost:5432/postgres --keycloak-database-uri postgresql://keycloak:keycloak@localhost:5432/keycloak --blob-dir /opt/anaconda/repo/state/internal/blobs/ > repo.backup.zip
Save the
repo.backup.zip
file to a secure location.Save the
REPO_TOKEN_CLIENT_SECRET
andREPO_KEYCLOAK_SYNC_CLIENT_SECRET
values from the.env
file in the installer directory.
Restoring Anaconda Server¶
Follow these steps to restore your instance of Anaconda Server:
Reinstall
pg_dump
andpg_restore
as shown above.Copy the
repo.backup.zip
file.Run the following command from the install directory:
# Replace <POSTGRES_PASSWORD> with your postgres password. You can find your postgres password here: <BASE_INSTALL_DIR>/config/postgres/postgres_db_password.txt ./repo-tools restore repo.backup.zip --database-uri postgresql://postgres:<POSTGRES_PASSWORD>@localhost:5432/postgres --keycloak-database-uri postgresql://keycloak:keycloak@localhost:5432/keycloak --blob-dir /opt/anaconda/repo/state/internal/blobs/
Modify the
.env
file in the install directory and replaceREPO_TOKEN_CLIENT_SECRET
andREPO_KEYCLOAK_SYNC_CLIENT_SECRET
with the values saved earlier.Run the following in the install directory:
docker-compose up -d repo_api