Full backup before running updates

As I am always afraid that an update might cause problems, I would like to do a full backup of the program files before running it (my data files are backed up nightly).
What directories do I need to tar in order that, if I wanted to do any update, I could simply delete a folder and untar?

Hi:
You have to backup mysql, record files and so on. Please refer this link:
http://wiki.freepbx.org/display/FPG/Using+the+Backup+module