fleet/tools/backup_db
Scott Gress 94eb573736
Add Fleet dev snapshot tool (#25909)
For #23750 

# Overview

This PR adds a basic tool for creating and restoring Fleet dev
snapshots. In this first iteration a snapshot is just a folder
containing a MySQL db dump made using the existing backup/restore
scripts, and the tool allows you to easily save and restore snapshots
interactively.

## Usage

* `make snapshot` to create a new snapshot
* `make restore` to select and restore a snapshot 

## Future plans

Future iterations can add metadata to snapshots to integrate things
like:

* node keys from osquery-perf, so you can easily reconnect to hosts
created in a previous session
* env vars from when the snapshot was made
* the branch from when the snapshot was made, to allow switching to that
branch and restarting the server as part of the restore process
*
![image](https://github.com/user-attachments/assets/6dc86581-5c12-4b57-b900-5034e00bc496)

## Demo


https://github.com/user-attachments/assets/1590c37a-3df9-4201-a42b-ccd1a36cb6cf
2025-02-05 09:52:10 -06:00
..
backup.sh Add Fleet dev snapshot tool (#25909) 2025-02-05 09:52:10 -06:00
README.md Updated testing.md (#6583) 2022-08-01 19:06:30 -05:00
restore.sh Add Fleet dev snapshot tool (#25909) 2025-02-05 09:52:10 -06:00
restore_e2e_software_test.sh MySQL 8.0 Migration (#20225) 2024-07-22 16:27:36 -04:00

These scripts are for backing up and restore the Docker development MySQL database.

Usage is documented here.