It is not necessary to keep all your photos in a single location, but doing so will make it much easier to backup or transfer the project as a whole.
Basically, in terms of backing up your project, you need to backup the project file (.tpy) and the original photos you imported into the project. (If you’re using custom templates you will also need to export those to be able to import them on a different device in the future.)
If you’d like to move existing photos to a new location (e.g., so that they’re all in a single root folder that can be copied easily) you can probably rely on Tropy’s auto-consolidation: this will work well, if you’re moving photos from four or five different locations. However, if the photos are really spread across multiple different folders, it’s probably easier to move the photos and then overwrite the paths in the project database manually using SQLite – if that’s the case, we can try to assist you with that, but otherwise it should not be too difficult to do using the consolidation command in Tropy.