See Move an Install to Another System and Where is the Plex Media Server data directory located?.
You’ll want to make a backup of the Plex Data Folder, then restore it after updating the NAS. Read the Move an Install… document to see all the steps.
If TerraMaster has a built in backup utility you may be able to use it for the backup and restore (I’m not familiar with Terramaster NAS).
If you can access the NAS via SSH, you may be able to use the Linux tar command for the backup and restoral. Use Plex Linux Tips: Backup, Restore, or Clone your PMS installation as a guide, and make appropriate changes for Terramaster NAS (the paths will be different, you probably won’t use systemctl to stop/start PMS, etc.).