[solved] Restore /home backup with Grsync

If none of the more specific forums is the right place to ask
Post Reply
Message
Author
User avatar
ticojohn
Posts: 1016
Joined: 2009-08-29 18:10
Location: /home/heart
Has thanked: 2 times
Been thanked: 7 times

[solved] Restore /home backup with Grsync

#1 Post by ticojohn »

I've been using Grsync to back up my /home directory for years, but have never had the occasion to restore a backup. Reading about the restore process, mostly regarding full system backups, I have read that one should NOT back up to the mounted system (eg the one I am logged in to). And the reasons make sense. However, I am wondering if I can restore just my /home directory while I am logged in. I exclude the .xsession logs and the .cache from the backup, just in case that would make a difference in your answers.

And just in case the answer is that I should not do the restore whole logged in, I might have an alternative solution. I have two user accounts on my desktop (and two other drives with Bullseye installed). Wondering if I could log in as the other user to restore to /home my main user. Lots of wondering here, but not yet wandering. LOL! Enlightenment would be wonderful!
Last edited by ticojohn on 2021-06-13 18:02, edited 2 times in total.
I am not irrational, I'm just quantum probabilistic.

User avatar
cds60601
Global Moderator
Global Moderator
Posts: 233
Joined: 2017-11-25 05:58
Location: Tampa, Florida
Has thanked: 5 times
Been thanked: 1 time

Re: Restore /home backup with Grsync

#2 Post by cds60601 »

To play it safe, login as another user, rename the directory in questions IE: /home/myname to /home/myname.orig
Then run your restore. Logout then in as the user you wish to and have a look around.
Server: Debian 10, Workstation: Debian Sid (dwm)
Laptop: Debian Sid (dwm), Pi-4: Sid (dwm)
----------------------------------------------------------------------------------
Don't Break Debian: https://wiki.debian.org/DontBreakDebian

User avatar
ticojohn
Posts: 1016
Joined: 2009-08-29 18:10
Location: /home/heart
Has thanked: 2 times
Been thanked: 7 times

Re: Restore /home backup with Grsync

#3 Post by ticojohn »

cds60601 wrote:To play it safe, login as another user, rename the directory in questions IE: /home/myname to /home/myname.orig
Then run your restore. Logout then in as the user you wish to and have a look around.
Not sure I follow you. Can I just rename my user home directory or just add another user directory in /home without creating a user? Sounds confusing to me, but I am still learning.

Why not just log in to /home/user and see if I can restore /home/user to the already existing /home/anybody? And if I can then I should be able to log in to /home/anybody and restore to /home/user.
I am not irrational, I'm just quantum probabilistic.

User avatar
cds60601
Global Moderator
Global Moderator
Posts: 233
Joined: 2017-11-25 05:58
Location: Tampa, Florida
Has thanked: 5 times
Been thanked: 1 time

Re: Restore /home backup with Grsync

#4 Post by cds60601 »

ticojohn wrote:
cds60601 wrote:To play it safe, login as another user, rename the directory in questions IE: /home/myname to /home/myname.orig
Then run your restore. Logout then in as the user you wish to and have a look around.
Not sure I follow you. Can I just rename my user home directory or just add another user directory in /home without creating a user? Sounds confusing to me, but I am still learning.

Why not just log in to /home/user and see if I can restore /home/user to the already existing /home/anybody? And if I can then I should be able to log in to /home/anybody and restore to /home/user.
You can, of course! I have done some similar things. What I have done was login as root, renamed the directory in questions (to preserve whatever might need preserving) than do your restore. At that point, you should be able to just login as that user, effectively into the restored home dir. Honestly, I never ran a resore over the dir I was in. I played it safe as I know that if you overwrite something that was needed, well, you know. When I am certain I no longer need the renamed dir, I then remove it. This works for me and may not be a good choice for others so I think you asking the questions before doing anything is good.

And to clarify - I rename the home dir so that the restore actually places the home dir where it should
Server: Debian 10, Workstation: Debian Sid (dwm)
Laptop: Debian Sid (dwm), Pi-4: Sid (dwm)
----------------------------------------------------------------------------------
Don't Break Debian: https://wiki.debian.org/DontBreakDebian

User avatar
ticojohn
Posts: 1016
Joined: 2009-08-29 18:10
Location: /home/heart
Has thanked: 2 times
Been thanked: 7 times

Re: Restore /home backup with Grsync

#5 Post by ticojohn »

@cds60601, thanks for your suggestions. I'm going to think on it awhile. When I figure out exactly what I'm going to do I'll get back and post what I did and the results. Hopefully successful results.
I am not irrational, I'm just quantum probabilistic.

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 3668
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 3 times
Been thanked: 4 times

Re: Restore /home backup with Grsync

#6 Post by sunrat »

To be absolutely safe and simple, I always do system backups or restores from a separate system either multiboot or a live USB. To backup $HOME to a separate drive I do it from the normal active system, but would restore it from a separately booted system. As you mentioned things like caches for DE and browsers get written often so even when backing up, from an active system some files may be changed between the time you start backup and when it finishes. Probably those changes won't matter at all but I'm fussy about those kind of things. :mrgreen:
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
ticojohn
Posts: 1016
Joined: 2009-08-29 18:10
Location: /home/heart
Has thanked: 2 times
Been thanked: 7 times

Re: Restore /home backup with Grsync

#7 Post by ticojohn »

sunrat wrote:To be absolutely safe and simple, I always do system backups or restores from a separate system either multiboot or a live USB. To backup $HOME to a separate drive I do it from the normal active system, but would restore it from a separately booted system. As you mentioned things like caches for DE and browsers get written often so even when backing up, from an active system some files may be changed between the time you start backup and when it finishes. Probably those changes won't matter at all but I'm fussy about those kind of things. :mrgreen:
Thanks @sunrat. Good advice. :)
I am not irrational, I'm just quantum probabilistic.

User avatar
ticojohn
Posts: 1016
Joined: 2009-08-29 18:10
Location: /home/heart
Has thanked: 2 times
Been thanked: 7 times

Re: Restore /home backup with Grsync

#8 Post by ticojohn »

I think my biggest issue with rsync has been thinking that it is something mystical. It's actually just a really sophisticated copy tool. With that, and with the advice and suggestions I have received, I am going to experiment and learn all I can about rsync, with my non-production installation. Thanks to those that commented. Will consider this closed.
I am not irrational, I'm just quantum probabilistic.

Post Reply