Modify "host" on existing backups

I didn’t fully realise the implications of hosts, paths or tags when I set up my repos, which means forget is doing the wrong thing currently and retaining old backups because the host changed (I changed hostname when I changed distros).

I want to change the host for older backups so that host is the same for all backups in a repo . How can I modify host for existing backups so that forget will not keep backups from xx months ago merely because the hostname changed?

1 Like

I don’t think you can modify hostname on existing snapshots but you can use --host from now on when running backup. Your solution right now is to run forget --keep-policies --group-by [tag|path|host]. If the path is already the same I’d recommend to use that option; otherwise, you can tag snapshots with the same tag an run --group-by tags your_tag.

1 Like

Since we have restic dump I’m hoping for a restic import that will take the same JSON structure and create a new object of the corresponding type. Then this type of migration (change host on some snapshots) could be scripted with a restic | jq | restic pipeline.

Hey there! Is there any way to do this? During my last backup my hostname changed for some reason – even though I use the same computer. I now what to change the host of the affected snapshot to have a consistent history.

Is there a github issue for this?

IMO such an import command would be pretty easy to implement. The maintainers however do hesitate to include new commands (for a good reason). But once there is a PR available it can be already used for cases like in this topic.

Extending the tags command to also allow modifying the hostname of a snapshot could be an alternative.

restic cat snapshot <id> | jq [...] | restic import seems to be rather messy to me.