The embedded database is just a series of files in the Openfire install tree, so stopping Openfire and then making a backup of that folder is all that you need to do.
In general though, you can just install/upgrade the 4.5 version and when you first start Openfire, it will do any database migrations automagically for you. You can test this in development first, by making an offline copy of your install to another system and trying the upgrade there.