There is no supported upgrade path; it requires a re-install.
In theory, you could remove the mysql database directory entirely, rpm -e all of the stack and foundation RPM's, rm -rf /export/stack/, and then you might have a more or less "clean" system, that you could install a newer stacki and restore (almost) everything from spreadsheets, but really you're just setting yourself up for trouble. Stacki depends on a lot of other RPM's that won't be cleaned up by that, and that all assumes you weren't using the Frontend for anything else that might be affected by this surgery.
There were a lot of changes between 3 and 4, and again between 4 and 5 -- you should really just export as much of your data as possible and start over.
Bill