Continue to increment the same backup with a different host

Hello,

I’ve been using Restic for a year and it works very well. Thanks for this!

Yesterday I migrated all my data from my old server to a new one, making sure that all file paths remained the same. So I thought my daily CRON with restic would continue to increment the same backup.

But, because the host has changed, restic has created a brand new backup.

Is there any way to disregard the host to deduce whether the backup already exists and needs to be completed, or whether it needs to be backed up entirely?

Sébastien

If only your hostname has changed, your first backup on that machine is slower because restic thinks that this is a whole new backup - you should see the no parent snapshot found, will read all files message. Your backup is fine and your files were properly deduplicated.

To speed up the first snapshots on the new host, I would just tell restic that the latest snapshot on the old host is the correct parent snapshot with --parent and move on. You can also force the old hostname with --host during the backup, but than you would need to to that on every new backup.

Edit: Now I’m thinking that only forcing the old --host won’t help, and all the files would be read anyway since the inodes had changed. You could try --ignore-inode and --ignore-ctime too. But if your new snapshot is finished, you don’t need to worry about these flags on the new host anymore - your next backups will be faster.

Also, you should consider reviewing your forget policies, since the host has changed and by default, the forget command groups the snapshots by “host,paths”. You can try to play with the --group-by flag (don’t forget the --dry-run) to see which one works for you. You can try to group by paths only, for example.

Hello, thank you for your reply!

I’m going to move another restic backup in the next few days (400GB). So I want to avoid another full backup for this one.

If I understand correctly, the best option would be to specify the parent ID for the first backup like this: ./restic backup --tag MY_TAG ~/www --parent a14e5863

Then the next backup will use the new snapshot with the new host, right?

That’s correct. --parent (just like you wrote it) is the key flag on the first new backup only to avoid reading all the files again. I don’t think I ever used --ignore-inode or --ignore-ctime, but you may need to use them since you moved the files to a new filesystem. You can always test how the first new backup runs with --dry-run, and this execution can be interrupted at any time.

Restic does not have the concept of full or incremental backup.
Due to changed hostname, timestamps or inode numbers (and maybe other factors), restic might need to read all data från the hard drive. But it will only upload data to the repository which is not there already, plus some metadata.

(Maybe this was a case of kicking in an already open door, but I just wanted to minimize the risk of a misunderstanding.)

2 Likes

Using ./restic backup --tag MY_TAG ~/www --parent a14e5863 --ignore-inode --ignore-ctime worked for me ! --ignore-inode was the key option because of the new filesystem.

Thanks for your support !

2 Likes