As we reach the end of September 2024, ThreadFix version 3.x on-premises has officially reached its End-of-Life. Therefore, there is no longer support or updates for this version of the product. We have fully transitioned our product and development teams to focus ThreadFix SaaS and migrating all customers over from the on-premises versions. Our Customer Success and Support teams are here to help you in migrating to ThreadFix SaaS and maximizing the value you see from this improved offering from Coalfire. This is the next phase of ThreadFix and our team is looking forward to continuing to support you on this journey.
Backup & Restore
You will learn
How to backup internal ThreadFix databases running in Kubernetes.
Prerequisites
Audience: IT Professional, or End User
Difficulty: Intermediate
Time needed: Approximately 15 minutes
Tools required: If any
Backing Up and Restoring Database with Kubernetes
The following document details how to backup internal ThreadFix databases running in Kubernetes.
To backup external databases please follow vendor instructions for creating database backups.
Vendor Links for External Database Backup and Restore
SQL Server: Create a Full Database Backup
Azure: Automated backups - Azure SQL Database & SQL Managed Instance
Backing Up Internal Kubernetes Database
The following should be performed on a bash compatible terminal with kubectl access to the Kubernetes cluster.
Locate the name of the ThreadFix database.
TF_DB=$(kubectl get po -l app.kubernetes.io/component=database,app.kubernetes.io/part-of=threadfix -o jsonpath='{.items[].metadata.name}')
Create the database backup file.
kubectl exec $TF_DB -- bash -c 'mysqldump -u$MYSQL_USER -p$MYSQL_PASSWORD --all-databases' > tf_db_dump.sql
Inspect the database dump to ensure the command completed successfully.
(Optional) gzip the database file.
gzip tf_db_dump.sql
Copy the database dump to a secure location.
Restoring Internal Kubernetes Database
Warning: This process is irreversible and will destroy all data in the ThreadFix instance.
Get Helm instance name.
Get the ThreadFix repository name.
If installing from a local helm chart, the user’s local chart file should be used as the ThreadFix chart name.
Export Helm values (replace
<tf_instance_name>
with the name gathered from step 1).Create db-only.yaml file with the following contents:
Restart ThreadFix in Database Only Mode (replace
<tf_instance_name>
with the values from step 1 and<tf_chart_name>
with the value from step 2).Drop existing data.
Locate the name of the ThreadFix database.
Restore data from the database dump file.
Restart ThreadFix with previous settings (replace
<tf_instance_name>
with the values from step 1 and<tf_repo_name>
with the value from step 2).Follow the on screen instructions to access the application.
Use
kubectl get po -w
to watch the installation progress
Complete Database Wipe and Restore (Advanced)
In rare circumstances, it is not possible to restore a database as is, and the database must be completely wiped. The most common cause of this is InnoDB corruption or a corrupted disk. In such situations the user may need to completely destroy the database instance and start from scratch. Please only attempt this after all other options have been exhausted.
Get Helm instance name.
Get the ThreadFix repository name.
Export Helm values (replace
<tf_instance_name>
with the name gathered from step 1).Create db-only.yaml file with the following contents:
Find the database PersistentVolumeClaim.
Find the database StatefulSet.
Delete the database StatefulSet.
Delete the database PersistentVolumeClaim.
Restart ThreadFix in Database Only Mode (replace
<tf_instance_name>
with the values from step 1 and<tf_chart_name>
with the value from step 2).Wait until the database is running (Use Ctrl-C to exit once the database status is running).
Locate the name of the ThreadFix database.
Restore data from the database dump file.
Restart ThreadFix with previous settings (replace
<tf_instance_name>
with the values from step 1 and<tf_repo_name>
with the value from step 2).Follow the on screen instructions to access the application.
Use
kubectl get po -w
to watch the installation progress
Table of Contents
www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.
This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.