How do I restore rsync backup files with the correct owner on a new machine?

Galen Elfert

I have backed up my home folder to an external (ext4) hard drive, preserving ownership and permissions. Now I want to do a fresh Linux install and then restore my home folder from the backup. But the ownership is just a UID number, and when I plug the drive into a different machine as a test, I see that the UID is associated with a different, incorrect user name on this machine. Is there a way to tell rsync to translate the UIDs on the backup files to the correct UIDs on the new machine when it restores the files?

meuh

rsync has two options to map userids and groupids during the copy. For example,

-o -g --usermap=1000:abc,1001:def --groupmap=1000:abc,1001:def

will convert user and group id 1000 in the backup to the name abc in the copy, and similarly 1001 to def. The -o -g options are included by -a, so you often won't need them explicitly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

With Snap and Apt both existing, how do I backup all my apps so that I can restore it on a new machine

From Dev

How do I restore an old Ubuntu backup to a new server

From Dev

How do I change destination directory owner when using rsync?

From Dev

How to restore backup to new disk

From Dev

How do I set up SSH to transfer files from my local machine to a shared server with rsync?

From Dev

How can i keep the mtime of files and directories when I use rsync or cp? For use in Backup/Incremental Backup

From Dev

Can I restore files from a Time Machine backup onto a different computer?

From Dev

How do I create and restore full Ubuntu partition backup?

From Dev

How to backup and restore Virtual machine OS?

From Java

Firestore new database - How do I backup

From Dev

How do I remove hidden backup files?

From Dev

How do I remove hidden backup files?

From Dev

How do I backup grub files / configuration on a new installation of Ubuntu 16.04?

From Dev

How to backup readable but not writable files using rsync?

From Dev

How do I add a new owner to my AWS account?

From Dev

How do I trim Time Machine backup history?

From Dev

How do I schedule a linux backup job on a machine that's not always on?

From Dev

Fresh Debian install. What files do I restore from a backup?

From Dev

How to rsync only new files

From Dev

How to do rsync-like encrypted backup?

From Dev

rsync just adds files and directories with new names to existing backup

From Dev

How can I restore a weird Windows backup?

From Java

Postgresql - backup database and restore on different owner?

From Dev

How can I access directly to my backup files, without having to restore them?

From Dev

How can I access directly to my backup files, without having to restore them?

From Dev

How do I image my hard drive for backup? Or do I just need to backup the files?

From Dev

How to restore a time machine backup from a newer OS version?

From Dev

How do I make rsync skip files that failed to transfer?

From Dev

How do I restore files removed from /usr/bin?

Related Related

  1. 1

    With Snap and Apt both existing, how do I backup all my apps so that I can restore it on a new machine

  2. 2

    How do I restore an old Ubuntu backup to a new server

  3. 3

    How do I change destination directory owner when using rsync?

  4. 4

    How to restore backup to new disk

  5. 5

    How do I set up SSH to transfer files from my local machine to a shared server with rsync?

  6. 6

    How can i keep the mtime of files and directories when I use rsync or cp? For use in Backup/Incremental Backup

  7. 7

    Can I restore files from a Time Machine backup onto a different computer?

  8. 8

    How do I create and restore full Ubuntu partition backup?

  9. 9

    How to backup and restore Virtual machine OS?

  10. 10

    Firestore new database - How do I backup

  11. 11

    How do I remove hidden backup files?

  12. 12

    How do I remove hidden backup files?

  13. 13

    How do I backup grub files / configuration on a new installation of Ubuntu 16.04?

  14. 14

    How to backup readable but not writable files using rsync?

  15. 15

    How do I add a new owner to my AWS account?

  16. 16

    How do I trim Time Machine backup history?

  17. 17

    How do I schedule a linux backup job on a machine that's not always on?

  18. 18

    Fresh Debian install. What files do I restore from a backup?

  19. 19

    How to rsync only new files

  20. 20

    How to do rsync-like encrypted backup?

  21. 21

    rsync just adds files and directories with new names to existing backup

  22. 22

    How can I restore a weird Windows backup?

  23. 23

    Postgresql - backup database and restore on different owner?

  24. 24

    How can I access directly to my backup files, without having to restore them?

  25. 25

    How can I access directly to my backup files, without having to restore them?

  26. 26

    How do I image my hard drive for backup? Or do I just need to backup the files?

  27. 27

    How to restore a time machine backup from a newer OS version?

  28. 28

    How do I make rsync skip files that failed to transfer?

  29. 29

    How do I restore files removed from /usr/bin?

HotTag

Archive