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 remote-tracking branch 'upstream/dev' into dev