Automatic DB restores now done if upgrade fails due to corrupt DB or incorrect db numbering
MainDB is backed up before being restored now to .r* versioned backup backups
Merge branch 'origin/dev'