It is known that TWRP does not back up /data/media
as you can read
here and on other posts on this site, also on TWRP FAQ
How can one bypass this?
There's an app that's just been released (tested on Moto X Play) that bridges the gap between Nandroid and full backup and backs up photos, videos, game data etc, which wasn't possible earlier
Tipatch (Play Store) and quoting from developers XDA thread
Tipatch patches TWRP to backup contents of internal storage (emulated SD card) as part of Data, thus preventing data loss. Internal storage typically includes items such as photos, videos, downloads, game data, and other assorted files.
A side effect is that wiping "Data" will also wipe internal storage. This cannot be fixed.
Programs (instead of using app) for all OS's available on Github
I am not affiliated in any way with the app or developer and wanted to share a tip-off from a friend
Edit: Also now tracker free version available in Izzy's F-droid repo
Edit 2 User alecxs who is a regular contributor here has a universal bind mount enabler, for the same functionality. You can download it from XDA. There is also a Magisk module "TWRP helper" that claims to do the same (not tested by me).
I would follow the idea from https://forum.xda-developers.com/android/general/tutorial-create-internal-storage-backup-t3389172 - that is
Step 1- reboot in recovery Step 2-mount all partitions Step 3-now open file manager Step 4-go to path /data/media Step 5-now rename media folder name to xyz (now path name is /data/xyz) Step 6- now go to backup window Step 7- now refresh memory.... u notice that data partition memory is increase (data+internal storage)
and then back up to your preferred location, e.g. external SD card.
Starting from TWRP version 3.4.0+ we can now make backup of Internal Storage straight from menu without any modification
thanks to the developers who finally decided to include that option after a long period of such feature request :)