Backing Up Data for Deployment Migrations

Erik Haake
Erik Haake
  • Updated

Published Date: December 12, 2023

Validated: Yes

Audience: Everyone

Products and Versions Covered:

  • Environment: Self-hosted - Data Backups
  • Deployment Migration(s):
    • On-premises to Cloud Migrations
    • On-premises to Customer-Validated Cloud Migrations

Summary

Our top recommended backup file type for deployment migrations is the .jama backup file. This comprehensive option, accessible through the backup tab in Jama Connect®root menu, encapsulates all necessary data, including the database and various assets such as attachments, reports, diagrams, equations, and metrics. It is particularly advantageous for small to medium-sized datasets and is fully compatible with Microsoft SQL Server and MySQL.

Customers must provide database backups and assets during deployment migrations. Assets must be backed up separately by tarring them for backups other than .jama files. For KOTS installations, customers must exec into the core-0 pod to perform this.

Backup procedures involve selecting options from the backup tab based on the backup type:

  • Option #3 for .jama backup

  • Option #2 for XML backup

Data set sizes are categorized into small, medium, and large based on the backup type (.jama, XML, MySQLDump).

This article covers:

  • .jama backup

  • XML backup

  • MSSQL proprietary backup

  • MySQLDump

  • Backing up assets

  • Data set sizing

Resolution

1. .jama Backup File

  • Accessed through the backup tab in Jama Connect® root admin panel.

  • Contains all necessary information, including the database and assets.

  • Suitable for small to medium datasets; compatible with MSSQL and MySQL.

Steps to create a .jama backup:

  1. Log in as the root user.

  2. Navigate to the backup tab.

  3. Select option #3 for the .jama backup.

  4. Use the examples below to locate your backups from within the core-0 pod and copy them to a local directory

  5. ## list the contents of the backup directory from within the core-0 pod
    kubectl exec core-0 -c core -- ls -lh /home/contour/tenant/<yourTenantName>/backup
    
    ## copy the backup from the core-0 pod to a local directory
    kubectl cp core-0:/home/contour/tenant/<yourTenantName>/backup/<yourBackupFile> ./<yourBackupFile> -c core
    
    ## examples
    kubectl exec core-0 -c core -- ls -lh /home/contour/tenant/jamasb/backup
    total 37M
    -rw-r----- 1 tomcat tomcat 24M Apr 14 15:15 backup202604141515.xml
    -rw-r----- 1 tomcat tomcat 13M Apr 14 15:15 jamasb__202604141515.jama
    
    kubectl cp core-0:/home/contour/tenant/jamasb/backup/backup202604141515.xml ./backup202604141515.xml -c core

2. XML Backup File

  • Accessed through the backup tab; includes only the database (no assets).

  • Recommended for moving large datasets from MSSQL to MySQL.

Steps to create an XML backup:

  1. Log in as the root user.

  2. Navigate to the backup tab.

  3. Select option #2 for the XML backup.

  4. Back up assets separately if needed (see “Backing up assets” section).

  5. File location: same as .jama backups


3. MSSQL Proprietary Backup


4. MySQLDump

  • Recommended for customers already on MySQL with extensive data.

Command:

mysqldump --max-allowed-packet=25M --single-transaction --skip-add-locks --routines --set-gtid-purged=OFF -u root -p DATABASENAME > DATABASENAME_$(date +%Y%m%d).sql

5. Backing up Assets

When using any option other than .jama, assets must be backed up separately:

Steps:

SPEC_NAME=$(kubectl get pod core-0 -o jsonpath='{.spec.containers[0].env[?(@.name=="TENANT_NAME")].value}') && \
kubectl exec core-0 -c core -- sh -c "
  PROP_NAME=\$(grep 'server.tenants=' /home/contour/tenant.properties | cut -d'=' -f2);
  if [ \"\$PROP_NAME\" != \"$SPEC_NAME\" ]; then
    echo \"ERROR: Misalignment! Spec: $SPEC_NAME vs Prop: \$PROP_NAME\" >&2;
    exit 1;
  fi;
  BASE_DIR=\"/home/contour/tenant/\$PROP_NAME\";
  EXISTING_DIRS=\$(cd \$BASE_DIR && ls -d attachments avatars diagrams equations reports tempreports 2>/dev/null);
  if [ -z \"\$EXISTING_DIRS\" ]; then
    echo \"ERROR: No valid asset directories found in \$BASE_DIR\" >&2;
    exit 1;
  fi;
  tar -C \"\$BASE_DIR\" -zcf - \$EXISTING_DIRS" > assets.tar.gz

 


Data Set Sizing:

Size XML Backup .jama Backup MySQLDump Archived Assets
Small ≤1 GB ≤2 GB ≤1 GB <1 GB
Medium 2–3 GB 2–3 GB 2–3 GB 2-5 GB
Large ≥3 GB ≥3 GB ≥3 GB ≥5 GB

Feedback:
We welcome your input! Please sign in to leave any comments, suggestions, or improvement ideas below.

 

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.