Upgrading to a new version of Openfire should not make you lose any data in your database. You can find the Upgrade Guide in the documentation page. This documentation is also present in your Openfire 3.4 installation.
I just performed the upgrade myself. One very important thing to note:
I didn’t blow away the old install directory, and when I restarted Openfire, I got HTTP 500 error messages all over the place regarding Java. I deleted the entire directory and then re-installed and copied the configs/database back and it worked fine.
It’s pretty easy to re-install the plugins anyways.
Here is a script I use to update my Debian Etch box after extracting the zip file. I still need to update it copy the old audit logs to the new install but I am considering moving them to a different location.