When reinstalling a system where user account was handled by systemd-homed, we can leverage homectl feature to do 99% of the migration on its own:
- no need to backup /etc/passwd,/etc/shadow, /etc/group. Instead, we can use homectl inspect -EE on the old system and use the output to homectl create -i . -E or -EE will strip part of the cryptographic keys (we need to decide if the original system keys should be migrated or not).
- homectl can also give the location of the homedir data, allowing the migration script or either do the btrfs send-receive copy or detect if luks container is used and give its path so it can be copied on the install key.