In theory, that should be possible. I haven’t testet it extensively, but this script should allow you to install every application in the repositories:
#!/bin/bash
flatpak search "" --columns=application,branch | while read line
do
APP=$(echo ${line} | awk '{print $1}')
BRA=$(echo ${line} | awk '{print $2}')
echo flatpak install -y ${APP}//${BRA}
done
When you’re done and want to clone the HDD, use the dd command:
Connect the source and destination disk to the same computer
Replace sda and sdb with the actual source and destination disk names (use dmesg to find out) and make sure that the destination is at least as big as the source.