Make backup tool part of the fuel-core binary. (#3131)
## Linked Issues/PRs - #3107 ## Description The backup tool provides functionality for exporting and restoring database snapshots. Currently, it exists as an independent CLI, which adds friction for users and complicates deployment. To streamline the developer experience and unify tooling, we want to expose its functionality directly under the fuel-core CLI. Proposed CLI Structure: ```bash fuel-core archive backup --from <path> --to <path> fuel-core archive restore --from <path> --to <path> ``` ## Checklist - [ ] Breaking changes are clearly marked as such in the PR description and changelog - [ ] New behavior is reflected in tests - [ ] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Integrates the backup tool into the fuel-core CLI as `archive backup|restore`, with tar-based archiving and restore support behind a new `archive` feature (enabled by default). > > - **CLI**: > - Add `archive` subcommand with `backup` and `restore` commands in `bin/fuel-core/src/cli/archive.rs`. > - Wire into main CLI in `bin/fuel-core/src/cli.rs` under `Fuel::Archive` (gated by `rocksdb`). > - **Features/Flags**: > - New `archive` feature (enabled by default) in `bin/fuel-core/Cargo.toml`. > - `rocksdb` feature now also enables `fuel-core/backup`. > - **Implementation**: > - Backup: dump DB to temp dir via `CombinedDatabase::backup`, then package per-DB tars and concatenate into final `db.tar`. > - Restore: extract concatenated tar into temp dir, then `CombinedDatabase::restore`. > - Parallel tar creation with `rayon`; tar handling via `tar`; temp dirs via `tempfile`. > - **Dependencies**: > - Add `tar`, `tempfile`, `rayon` to `fuel-core-bin`; lockfile updates (e.g., `tar`, `filetime`, `xattr`). > - **Changelog**: > - `.changes/added/3131.md` entry noting the new `archive` subcommand. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 16ad56d1e82019b026a455ab6d752754641a7527. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
S
Saeed Dadkhah committed
b9d108aad696975a27d60485c3faa65f6a7b525f
Parent: a66f05c
Committed by GitHub <noreply@github.com>
on 11/19/2025, 12:55:07 AM