For a database backup - the easiest way is to use the native phpBB Backup feature: select all tables, execute and the resulting database backup will be saved in the /store. The file will have a long and strange name, e.g. backup_1652658688_le1dp1j0bgbzwek1.sql.gz or backup_1652658688_le1dp1j0bgbzwek1.sql depending on whether compression was selected or not.
That's the only file you absolutely need to keep in order to be able to rebuild a board. The phpBB files can always be (re)downloaded from here.
However, in you have custom images (or attachments) on your board, you will also need to backup those.
The easiest way would be to first take a database backup (which will be stored in /store) and then take a backup of your whole board directory.
That way you won't have to mess with separate db and file backups.
Have a look at
Forum Backup Instructions
In the article, section File Backup, there is mention of separate directories. As mentioned previously I would not backup the separate directories but just backup the whole board: less work and no risk of forgetting anything.