Upgrades must be performed one by one, i.e. for each node, stop it, upgrade it : change [stateVersion](#opt-system.stateVersion) or [services.garage.package](#opt-services.garage.package), restart it if it was not already by switching.
- **Multiple version upgrades.**
Garage do not provide any guarantee on moving more than one major-version forward.
E.g., if you're on `0.7`, you cannot upgrade to `0.9`.
You need to upgrade to `0.8` first.
As long as [stateVersion](#opt-system.stateVersion) is declared properly,
this is enforced automatically. The module will issue a warning to remind the user to upgrade to latest
Garage *after* that deploy.
## Advanced upgrades (minor/major version upgrades) {#module-services-garage-advanced-upgrades}
Here are some baseline instructions to handle advanced upgrades in Garage, when in doubt, please refer to upstream instructions.
- Verify the resulting logs and check that data is synced properly between all nodes.
If you have time, do additional checks (`scrub`, `block_refs`, etc.).
- Check if queues are empty by `garage-manage stats` or through monitoring tools.
- Run `systemctl stop garage` to stop the actual Garage version.
- Backup the metadata folder of ALL your nodes, e.g. for a metadata directory (the default one) in `/var/lib/garage/meta`,
you can run `pushd /var/lib/garage; tar -acf meta-v0.7.tar.zst meta/; popd`.
- Run the offline migration: `nix-shell -p garage_0_8 --run "garage offline-repair --yes"`, this can take some time depending on how many objects are stored in your cluster.
- Bump Garage version in your NixOS configuration, either by changing [stateVersion](#opt-system.stateVersion) or bumping [services.garage.package](#opt-services.garage.package), this should restart Garage automatically.