If you want to restore the data partition on a Fairphone 3 with TWRP, before restoring make sure that encryption would be set up the same way as when the backup was made.
I have successfully restored the complete state of the phone following these steps …
- Install the OS build that matches the data partition to restore.
(I needed to match the build this way, else restoring the data partition would fail.)
- Boot the installed OS, set up the screen lock (= the decryption method) in the same way it was set up when the backup of the data partition was made.
(Else restoring the data partition would fail.)
- Restore the data partition with TWRP.
- Copy the whole Internal Storage back to the phone (since TWRP doesn’t include Internal Storage in a backup, so I always use other means to backup Internal Storage).