Migrating Timeshift Snapshots

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Nervous_Testpilot
Level 1
Level 1
Posts: 17
Joined: Sun Oct 02, 2022 11:37 am

Migrating Timeshift Snapshots

Post by Nervous_Testpilot »

Hello everyone :D

I'm using Timeshift for about an year now. Nothing special, just regular old rsync backups with default settings. I'm currently using Linux Mint 21.
Sadly my harddrive on which i store my Timeshift backups, is showing it's age and is about to fail. So before everything goes to hell i decided to migrate my backups to another, new harddrive. Only problem is that, there are over 5 Million tiny files to copy. The large files copy pretty quick but the rest would take a long, long, long time, about a week according to the counter. So i figured, hey why not put everything into a .tar archive and copy the whole thing in one big swoop.

So here is what i did.
In Console:

1. I navigated to / of the old harddrive

2. Then i did :

Code: Select all

sudo tar -cvf Timeshift_Snapshots timeshift
3. Then i copied the .tar archive to my new harddrive

4. Generate checksum for the .tar archive on the root of the old harddrive, the new one and compared them, to make sure nothing got corrupted during the copy process.

5. Right -Click -> Extract to...

6. Extracted the whole .tar archive to the root of the new harddrive

7. Tell Timeshift to use the new harddrive from now on.

My question now is the following:

Is this safe and correct what i did? Will these snapshots, after i extracted them from the .tar archive work normally as they should?
I remember a friend of mine had a big problem with his snapshots working properly, after he moved them to another harddrive.
Although he compressed them into a .tar.gz archive and then decompressed them on his new harddrive. As you can see i did not apply any compression to my archive but i'm still unsure about the way i did it.
Last edited by LockBot on Tue May 30, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Migrating Timeshift Snapshots

Post by AZgl1800 »

all I would do, is use a new drive, be sure to change the storage location to that new drive, and make a new Timeshift snapshot as of "now"

you don't need all of the previous ones
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: Migrating Timeshift Snapshots

Post by linux-rox »

Agree 100% with AZgl1800. If the system is functioning correctly now, creating a new archive will be fine (and, of course, much easier).

If you are keen to save the old archive, you have to take account of the fact that Timeshift uses hard links. This is how the archive can have a dozen snapshots (for example) yet only one copy of each file. If you copy by any normal means, you end up with multiple copies of each file. Is the transferred archive the same size after extraction? If so, that means tar preserved the hard links and all is well. A simpler way of achieving the same thing is to copy the archive with rsync using the -H flag. I tested that at some point, out of curiosity, and it seemed to work fine.

Again, though, if the system is running well, a new archive will be cleaner, faster and easier.

Edited to correct a critical typo. Should be -H, not -h as originally posted.
Last edited by linux-rox on Mon Dec 05, 2022 1:18 pm, edited 1 time in total.
mikeflan
Level 17
Level 17
Posts: 7155
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Migrating Timeshift Snapshots

Post by mikeflan »

FreeFileSync really is a good program, but I doubt it would work this magic :?:
User avatar
AZgl1800
Level 20
Level 20
Posts: 11184
Joined: Thu Dec 31, 2015 3:20 am
Location: Oklahoma where the wind comes Sweeping down the Plains
Contact:

Re: Migrating Timeshift Snapshots

Post by AZgl1800 »

Unless you want to go back in time,

the LAST SNAPSHOT, is the only "good snapshot" you need.

quit worrying about archives, just move on with the new HDD/SDD and create a new snapshot.
all is good.

for me:?
I save 5 dailys and move on.
LM21.3 Cinnamon ASUS FX705GM | Donate to Mint https://www.patreon.com/linux_mint
Image
Nervous_Testpilot
Level 1
Level 1
Posts: 17
Joined: Sun Oct 02, 2022 11:37 am

Re: Migrating Timeshift Snapshots

Post by Nervous_Testpilot »

linux-rox wrote: Wed Nov 30, 2022 1:21 pm Agree 100% with AZgl1800. If the system is functioning correctly now, creating a new archive will be fine (and, of course, much easier).

If you are keen to save the old archive, you have to take account of the fact that Timeshift uses hard links. This is how the archive can have a dozen snapshots (for example) yet only one copy of each file. If you copy by any normal means, you end up with multiple copies of each file. Is the transferred archive the same size after extraction? If so, that means tar preserved the hard links and all is well. A simpler way of achieving the same thing is to copy the archive with rsync using the -h flag. I tested that at some point, out of curiosity, and it seemed to work fine.

Again, though, if the system is running well, a new archive will be cleaner, faster and easier.
Thank you very much for your explanation :D . I did some testing in the last few days, and yeah it's kinda cleaner to do start all over. I think i keep some snapshots from my vanilla install, if i reaaaally need to go way back. But yeah thanks a lot, it helped to decide which way is the right one for me.
Last edited by Nervous_Testpilot on Mon Dec 05, 2022 1:10 pm, edited 1 time in total.
Nervous_Testpilot
Level 1
Level 1
Posts: 17
Joined: Sun Oct 02, 2022 11:37 am

Re: Migrating Timeshift Snapshots

Post by Nervous_Testpilot »

AZgl1800 wrote: Wed Nov 30, 2022 6:52 pm Unless you want to go back in time,

the LAST SNAPSHOT, is the only "good snapshot" you need.

quit worrying about archives, just move on with the new HDD/SDD and create a new snapshot.
all is good.

for me:?
I save 5 dailys and move on.
Thanks a lot for your answer :D , it helped decide what the right way to go is for me.
linux-rox
Level 10
Level 10
Posts: 3334
Joined: Sun Jul 19, 2020 9:17 pm

Re: Migrating Timeshift Snapshots

Post by linux-rox »

Aargh, just noticed a huge typo. The rsync flag to preserve hard links is -H, not -h. Have edited my first post to correct the error.

And glad we could help, Testpilot.
Locked

Return to “Beginner Questions”