Commit graph

10 commits

Author SHA1 Message Date
Ian Littman
7d4acdc5c4
Bump supported MySQL versions (#40892)
Fixes #40975.

8.0.32 (was running in Aurora managed cloud at the time) -> 8.0.39 (what
we're running now) 8.0.36 -> 8.0.44 (latest 8.0.x version supported by
Aurora; holding off on 8.0.45 until Aurora supports it) 8.4.7 -> 8.4.8
9.5.0 -> 9.6.0

Also bumped the supported Aurora version from 3.07.0 to 3.08.2 to match
what we're running in managed cloud right now

Fleet might work on older patch versions but we'll no longer dev/test on
them. MySQL 9.x not testing previous minor versions matches with our
previous approach for that version.

Since these are all patch/minor bumps (and the overnight build cases are
patch bumps/are covered by AWS envs) automated testing should be
sufficient here.
2026-03-04 12:25:20 -06:00
Dante Catalfamo
8dd5df1d06
Add script that backs up and restores DB when switching branches (#31197)
If this script is added as the `post-checkout` git hook, if the branch
you're switching to has different migrations from the one you're coming
from, it will automatically dump the current db, and restore the dump
from the last time you visited this branch. If no dump exists, it just
leaves the DB as-is
2025-08-06 13:34:51 -04:00
Scott Gress
f5f2a16867
Clear db before restoring from backup (#26928)
For #26478 

## Details

This PR updates the db snapshot script to have it add a `drop database
if exists` line to the top. This means that snapshots will start from a
clean state, so that they won't get out of sync with migrations.

## Testing

I tested this by:

1. starting with an up-to-date database, restoring an old snapshot while
on the main code branch, then trying `fleet prepare db`.
2. This failed because the migrations it tried to run were creating
tables that already existed in the database.
3. I made a new copy of this snapshot by dropping my db and doing
`create database fleet`, restoring the snapshot and snapshotting again.
4. On the main branch, I reset my db using `make db-reset` and then
restore my new snapshot
5. Finally, did `fleet prepare db` and this time it worked since the new
snapshot dropped the database before restoring.
2025-03-10 10:01:52 -05:00
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
Dante Catalfamo
5e1a3d03ae
MySQL 8.0 Migration (#20225)
#17249
2024-07-22 16:27:36 -04:00
Victor Lyuboslavsky
8d253fe19a
Updating user now updates activity feed. (#18962)
#18766
Fixed a bug where updating user via `/api/v1/fleet/users/:id` endpoint
sometimes did not update the activity feed and returned the un-updated
user object.

You must use a DB configuration with a replica to reproduce the issue.

# Checklist for submitter

<!-- Note that API documentation changes are now addressed by the
product design team. -->

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [ ] Added/updated tests
- [x] Manual QA for all new/changed functionality
2024-05-14 15:06:23 -05:00
Victor Lyuboslavsky
8e2ca6ea50
Updated backup.sh to dump UTF8. (#17100)
#17099
2024-02-23 13:49:23 -06:00
Lucas Manuel Rodriguez
e39ba93a90
Orbit to wait for osqueryd extension manager socket to be ready (#3836)
* Wait for osquery extension manager socket to be ready

* PR review feedback

* Add WIP Github Action to test orbit

* Set fleet address on fleetctl

* Add logging for troubleshooting

* Add prepare db statement

* Use tls-skip-verify on fleetctl

* Move steps around

* Fix addresses

* Fix fleetctl path

* Add certs.pem to orbit root dir

* Add orbit logs

* Increase timeout

* Add proper orbit log paths

* Fix tmp path orbit

* Add get hosts command to troubleshoot

* Fix orbit job termination

* Add comments to workflows

* Wait for server to go down

* Add orbit Windows job

* Use bash on windws-latest

* Fix missing quote

* Run orbit on Ubuntu

* Bump host count

* Increase timeout for extensions and not terminate on err

* Add comment to clarify high timeout value

* Revert change, we do want to exit in case of err
2022-02-22 15:05:32 -03:00
Luke Heath
5866d68f13
Set max length for name inputs (#4063) 2022-02-08 19:40:38 -06:00
Zach Wasserman
9ec122c249
Backup and restore for development database (#480)
Tooling to make backup and restore of the development database easy.
2021-03-16 08:33:42 -07:00