On the donor system:
Collect the correct "owner:group" ownership
find /etc /usr /bin /boot /dev /home /media /mnt /opt /proc /sys -exec stat --format 'chown %U:%G ${MPOINT}%n' {} \; > /tmp/restoreperms_chown.sh
Collect the correct permissions
find /etc /usr /bin /boot /dev /home /media /mnt /opt /proc /sys -exec stat --format "chmod %a ${MPOINT}%n" {} \; > /tmp/restoreperms_chmod.sh
Copy /tmp/restoreperms_chown.sh and /tmp/restoreperms_chmod.sh to the target system and execute them
Recheck on the target system where files still belong to user and group vasya, and create a script to change their ownership to root
find / -group vasya -user vasya -exec stat --format 'chown root:root ${MPOINT}%n' {} \; > /tmp/restoreperms_chown.sh
