OK, so I’ve finally tested it with XA2 Ultra. The partition to backup in this device is mmcblk0p76 and the resulting .img file is slightly above 20 GB. It contains both rootfs and home. Restoring it took about 10 minutes.
Restore went flawlessly, except for that the Android support itself did not restore. The App Support page in Settings wasn’t showing any information - all fields were empty, API level was shown as 0 and App Support couldn’t be started. But it only took uninstalling and reinstalling App Support from the Jolla store to make it work again like it was prior to backup.
So the question is: where does Android App Support get installed? Is it some other partition than rootfs and home? Clearly so. In such case, it would take making a backup of that other partition, too, in order to be able to restore the OS in an identical state, including a fully working App Support…
========
Now, the next thing to test is the 10 III. I already made a backup of it. The userdata partition on the 10 III is sda79.
Unlike in case of the XA2 Ultra where it is 20 GB, on the 10 III it is 128 GB, which is quite troublesome. In order to fit it on a 128 GB memory card, I had to gzip the backup on the fly, i.e.
dd if=/dev/sda79 | gzip > /mnt/userdata.img.gz
which compressed the image from over 100 GB to 19 GB. It took more than 1 hour to do it.
But I’m yet to take the risk to try to restore it, as the 10 III is my daily driver and I currently cannot afford to possibly screw it and have to reinstall everything from scratch. But I guess that I won’t resist it for too long and I’ll try it soon.
BTW. Is there some other way than dd to backup a partition to an image file, but only the “used” part rather than the entire partition, bit by bit, including all the unused space? It is extremely time and space consuming on the 10 III to have to backup (and then restore) the entire 128 GB…