Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restic-rewrite: change snapshot metadata #2654

Open
ATLief opened this issue Mar 18, 2020 · 5 comments
Open

restic-rewrite: change snapshot metadata #2654

ATLief opened this issue Mar 18, 2020 · 5 comments
Labels

Comments

@ATLief
Copy link

ATLief commented Mar 18, 2020

Output of restic version
restic 0.9.6 compiled with go1.13.4 on linux/amd64

What should restic do differently? Which functionality do you think we should add?
restic should have the ability to change the metadata of existing snapshots. Properties that should be modifiable include: Paths, Host, ID, Time, and Tags.

What are you trying to do?
Since moving to restic, I have converted previous system backups (from different backup solutions) into restic snapshots with the appropriate metadata. Unfortunately I made a few mistakes with some of the snapshots' Times and Paths. If I'd like to correct those mistakes now, I'd need to restore each snapshot, remove it from restic, and back it up again with the correct metadata.

This also has the unfortunate side effect that when I specify --path, these older snapshots aren't selected for listing for forgetting.

@rawtaz
Copy link
Contributor

rawtaz commented Mar 18, 2020

@ATLief Thanks, but can you be more specific about your use case? Please give one or a couple of concreted examples of what metadata you want to change, from what and to what.

@ATLief
Copy link
Author

ATLief commented Mar 18, 2020

@rawtaz

ID Time Host Tags Paths

Current:

a9baf756 2018-08-18 22:11:23 postulate old2,important /mnt/backup/duplicity/1
b69c1e31 2018-08-20 13:00:02 postulate old2,important /mnt/backup/duplicity/2

Desired:

a9baf756 2018-08-18 22:11:23 postulate old2,important /
b69c1e31 2018-08-20 13:00:02 postulate old2,important /

Current:

7b9e60da 2020-02-09 15:54:56 postulate new /,/proc/cpuinfo,/proc/mdstat,/proc/meminfo,/proc/partitions
092d5547 2020-02-11 10:04:01 postulate new /,/proc/cpuinfo,/proc/mdstat,/proc/meminfo,/proc/partitions

Desired:

7b9e60da 2020-02-09 15:54:56 postulate new /
092d5547 2020-02-11 10:04:01 postulate new /

Current:

964d8b03 2019-07-31 23:16:06 postulate old /
90ed2cdc 2019-08-31 23:16:16 postulate old /

Desired:

964d8b03 2019-07-21 23:04:01 postulate old /
90ed2cdc 2019-08-21 23:04:01 postulate old /

Current (Hypothetical):

0db2e713 2020-03-01 23:04:01 postulate new /
731e44e0 2020-03-08 23:04:01 postulate new /

Desired (Hypothetical):

2db2e714 2020-03-01 23:04:01 postulate new /
531b44e1 2020-03-08 23:04:01 postulate new /

All without changing the actual content of the snapshots.

@MichaelEischer
Copy link
Member

You can already add/remove tags with the tag command. Tampering with the Host and Time field would probably be not to hard to implement. Cosmetically changing the paths should be easy too, but when mounting such a snapshot the files will still be located under their original path.

As the snapshot ID is defined by the hash of all snapshot metadata, there's no way to keep the ID identical across changes or even modify it.

@MichaelEischer MichaelEischer added type: feature suggestion suggesting a new feature state: need direction need key decisions or input from core developers labels May 15, 2022
@MichaelEischer MichaelEischer added category: rewrite and removed state: need direction need key decisions or input from core developers labels Oct 30, 2022
@gab50000
Copy link
Contributor

I have opened a (draft) pull request which allows rewriting host and time of a snapshot.
See #4573

@gab50000 gab50000 mentioned this issue Nov 27, 2023
8 tasks
@neclepsio
Copy link

@gab50000 are you working on rewriting paths, as the issue asks? Because that's exactly what I just asked in the forum. If not, I would try myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants