So if your upgrade is an 'in place' upgrade without having to reformat the systems, then it is likely that you can upgrade without disturbing surgemail.
Or it may only require that you restore the startup scripts and /etc/surgemail.ini (or \windows\surgemal.ini)
If on the other hand you are doing an upgrade which requires reformatting drives, then you would need to restore surgemail completely after the upgrade or use mirroring to achieve the process. See this page!
In either case, I would start with these commands on the master server to ensure the mirror is up to date. Assuming you have a mirror server! (you should have one)
tellmail resync_config
tellmail resync_prune
(give it an hour or two to complete).
Then I would make sure I had a full backup of the system to be upgraded!
Then separately copy /etc/surgemail.ini to somewhere you can restore it from easily.
Then do the system upgrade.
Then restore surgemail.ini (if it's missing), and restore the startup scripts by typing in:
/usr/local/surgemail/surgemail -install_startup
(or \surgemail\surgemail -install_startup)
Then all should be well and good. Another option is to run the full installer and then replace surgemail.ini and restart surgemail.