Backup and Restore of "dot" folders and files in Home directory

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.
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Backup and Restore of "dot" folders and files in Home directory

Post by all41 »

I know people AndyMH for one, who bring their .mozilla folder with them to new editions of mint, and have done so for many updates, ME too, and I'm sure many others have to, especially this folder.
Sure--just make sure the FF editions are the same. Update the source to the same FF edition as the destination.
Copy .mozilla over to the newly installed system. Same with .thunderbird. Saves a ton of work
Everything in life was difficult before it became easy.
rickNS
Level 9
Level 9
Posts: 2968
Joined: Tue Jan 25, 2011 11:59 pm

Re: Backup and Restore of "dot" folders and files in Home directory

Post by rickNS »

all41 wrote: Sat Feb 04, 2023 6:02 pm
Sure--just make sure the FF editions are the same. Update the source to the same FF edition as the destination.
Actually even that is not necessary, am sure I have done it before without "matching" versions of Firefox.
But to be 100% sure I just now did it again. I took the .mozilla directory (636MB) from Mint 19.0, Firefox version 84.0.2, (yeah I'm not much for updates) and pasted it into a freshly installed Mint 21.0 Virtual Machine (Firefox had never run yet) and where the version of Firefox is 103.0.

Started Firefox, not a single complaint when it opened to the same page, with the same 5 tabs open. That is 100% verifiable.

Now having said that I do seem to recall reading somewhere that you will get problems if you try to copy a newer profile version into an older Firefox version ? If that is in fact the case if I did update my Mint 19 to the newest available firefox apt policy firefox shows 109.0, I would have had problems.

I took an actual picture, but the details would be kind of hard to see on here.
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Backup and Restore of "dot" folders and files in Home directory

Post by all41 »

rickNS wrote: Sat Feb 04, 2023 9:01 pm
all41 wrote: Sat Feb 04, 2023 6:02 pm
Sure--just make sure the FF editions are the same. Update the source to the same FF edition as the destination.
Actually even that is not necessary, am sure I have done it before without "matching" versions of Firefox.
But to be 100% sure I just now did it again. I took the .mozilla directory (636MB) from Mint 19.0, Firefox version 84.0.2, (yeah I'm not much for updates) and pasted it into a freshly installed Mint 21.0 Virtual Machine (Firefox had never run yet) and where the version of Firefox is 103.0.

Started Firefox, not a single complaint when it opened to the same page, with the same 5 tabs open. That is 100% verifiable.

Now having said that I do seem to recall reading somewhere that you will get problems if you try to copy a newer profile version into an older Firefox version ? If that is in fact the case if I did update my Mint 19 to the newest available firefox apt policy firefox shows 109.0, I would have had problems.
I took an actual picture, but the details would be kind of hard to see on here.
Interesting--
It's been a while but I remember copying an older .mozilla over and the newer FF version would not accept and showed errors.
Since then I match the versions and just rename .mozilla in the destination before copying over--just in case I have to revert.
With matching versions absolutely no problems.
Everything in life was difficult before it became easy.
rickNS
Level 9
Level 9
Posts: 2968
Joined: Tue Jan 25, 2011 11:59 pm

Re: Backup and Restore of "dot" folders and files in Home directory

Post by rickNS »

all41 wrote: Sat Feb 04, 2023 9:34 pm
Interesting--
It's been a while but I remember copying an older .mozilla over and the newer FF version would not accept and showed errors.
Since then I match the versions and just rename .mozilla in the destination before copying over--just in case I have to revert.
With matching versions absolutely no problems.
Yes it may have been awhile, as I know I've done it a few times, and as I just mentioned I'm not big on updates, it being one of the reasons I left wondows.
But we have been here together for quite awhile now, and I know you know I would not "make stuff up".
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
User avatar
all41
Level 19
Level 19
Posts: 9520
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Backup and Restore of "dot" folders and files in Home directory

Post by all41 »

Well you just retested this first-hand so yeah--good data--I'll have to pay special attention going forward-
this seems contrary to my experiences of just copying the entire .mozilla over to newer FF versions.
Everything in life was difficult before it became easy.
Argon_uk
Level 1
Level 1
Posts: 35
Joined: Fri Oct 11, 2013 12:10 pm
Location: London, UK

Re: Backup and Restore of "dot" folders and files in Home directory

Post by Argon_uk »

Thanks again for all of the very helpful advice given in this thread — much appreciated! :D

Based on all that I've read here and my own further thoughts, here is my proposed backup strategy for my new LM21.1 system:
  1. Install a secondary internal SATA3 SSD drive as a quick (transfer speed and self-contained) repository for backups. I'll create one ext4 partition (owned by root) that is used exclusively for TimeShift backups and another ext4 partition (owned by me) for Home backups, including "mirrors" from rsync runs. I'll aim to edit fstab (another exercise in reading the manuals!) so that the latter partition is automatically mounted on startup at /mnt/IntBackup and is therefore constantly available.
  2. At intervals depending on what I'm doing, I'll connect my external USB3 hard drive (auto-mounted at /media/$USER/ExtBackup) to carry out batches of backups from Home, including "mirrors" from rsync runs as above.
  3. I'll also carry out separate regular incremental backups (rsync without --delete option) of my individual (not "dotted") folders for documents/photos/other media to /mnt/IntBackup, /media/$USER/ExtBackup, DVDs and any other places that occur to me.
  4. Periodically run Clonezilla or Foxclone (probably the latter as I've tried it out and it looks good) to create images of my system drive onto another dedicated external hard drive.
As I understand it from this thread, my rsync scripts for the internal and external "mirror" backups will look something like this:
  • rsync -avhx --delete --exclude .cache --exclude Unmirrored /home/ /mnt/IntBackup/Mirrors <-- I believe this creates and maintains a "mirrored" folder hierarchy (starting with a $USER folder at the top, due to the slash after "/home") within the "Mirrors" folder on the internal backup partition
  • rsync -avhx --delete --exclude .cache --exclude Unmirrored /home/ /media/$USER/Mirrors <-- Ditto but on the external backup drive
To explain the "Unmirrored" exclusion in the above, I have several GB of archive documents and photos that are heavily backed up and unchanging. I want to keep them available but I don't need to keep running rsync over them, so I reason that I can achieve that by putting them all inside a top-level "Unmirrored" folder in my home directory and using the above script. Does that make sense?

If I've understood all this correctly, then I believe that my disaster recovery procedure (after failure of system drive) becomes:
  1. Populate replacement hard drive with drive partition images from most recent Clonezilla or Foxclone backup
  2. Run Timeshift (either from restored system drive or LM "live" USB stick — not sure which is better) and restore to most recent system snapshot
  3. Restore /home directory from latest mirror (either internal or external drive)
  4. If necessary, add any files that have been backed up incrementally but not included in the latest mirror
Is this a plausible approach? Thanks for any further pointers. :)
rickNS
Level 9
Level 9
Posts: 2968
Joined: Tue Jan 25, 2011 11:59 pm

Re: Backup and Restore of "dot" folders and files in Home directory

Post by rickNS »

Argon_uk wrote: Mon Feb 06, 2023 10:56 am
To explain the "Unmirrored" exclusion in the above, I have several GB of archive documents and photos that are heavily backed up and unchanging. I want to keep them available but I don't need to keep running rsync over them, so I reason that I can achieve that by putting them all inside a top-level "Unmirrored" folder in my home directory and using the above script. Does that make sense?
If by 'heavily backed up" you mean also in other places, then yes it makes sense, otherwise no, as they will have "no cost" in time or space, other than the first run. "I don't need to keep running rsync over them", that is the whole point of rsync (smart copy) as all the files in 'unmirrored' will not have changed they will not be copied over, and over.
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
Locked

Return to “Beginner Questions”