Hello @Sansh ,
It is mostly STM32CubeMX that manages code for the hardware.
Since you made a GUI on a MCU and want to use the GUI on another MCU, perhaps the best thing would be to create a new project with a TBS adapted to the new MCU (and probably board, display, memories and other peripherals) and then open TouchGFX Designer and go on Edit => Import => GUI and select the GUI (.touchgfx file) you made on the previous MCU.
This way you will import your GUI on the new MCU.
If you have code "outside" of the TouchGFX namespace, you will have to manually include the other changes/files because the import GUI feature only cares about the GUI files obviously.
I hope this helps! If not, could you please give more details about what you want to achieve?
If this comment answers your question, I invite you to select it as "best answer".
Regards,