Fix bug with upgrading non-MySQL DB to v5