When a Privia server is upgraded, the file store and the database are both retained.  The upgrade process does modify the database to alter the tables for the new features of the upgrade, but data is never deleted.  The process used in an upgrade also includes making a backup of the system so that if there are any problems during the upgrade the system can be restored back to the exact state that the server was in prior to starting the upgrade.