Manage automatic db upgrade from 5 to 7 version. Refs #2669