Right, this is always good practice to have DB backup prior to upgrade.
In addition, you can also run
nxdbmgr check
ideally two times - one prior to NetXMS upgrade and the other one after. First run fixed issues, if any, so upgrade runs in a clean way. Second time happens with newer version of nxdbmgr that may have new checks added.