fix #2467: recreate database if it cannot be opened
Merge branch 'release' into upstream