Rsync

Backup

To put files to exclude in a separate file, use the --exclude-from flag and specify a file with a list of files / folders:

Exclusion list:

/.mozilla/firefox/*/lock
/.mozilla/firefox/Profiles/*/lock
/.gvfs
/.pulse

Rsync script:

#!/bin/bash
SOURCE=$HOME
DESTINATION=/path/to/destination/
LOGFILE=/path/to/logfile
rsync -tvrL --log-file $LOGFILE --exclude-from '/path/to/exclusion/list' $SOURCE $DESTINATION

Migrating a rootfs

Start a live session that has access to the source drive and the target drive. Mount those drives and migrate the data using the below rsync command:

rsync --archive \
    --hard-links \
    --executability \
    --acls \
    --xattrs \
    --sparse \
    --numeric-ids \
    --info=progress2 \
    --exclude='/dev' \
    --exclude='/proc' \
    --exclude='/sys' \
    src dst

Then chroot into the dst system and reinstall the boot loader. Adjust hostname etc. as needed.