private static String recreateDatabase(final DbHelper dbHelper) {
        final File dbPath = databasePath();
        final Uri uri = ContentStorage.get().writeFileToFolder(PersistableFolder.BACKUP, FileNameCreator.forName(dbPath.getName() + DB_FILE_CORRUPTED_EXTENSION), dbPath, false);
        if (uri != null) {
            Log.i("DataStore.init: renamed " + dbPath + " into " + uri.getPath());
        } else {
            Log.e("DataStore.init: unable to move corrupted database");
        }
        try {
            database = dbHelper.getWritableDatabase();
            return null;
        } catch (final Exception f) {
            final String msg = "DataStore.init: unable to recreate database and open it for R/W";
            Log.w(msg, f);
            return msg + ": " + f.getMessage();
        }
    }
Attempt to recreate the database if opening has failed

@param dbHelper dbHelper to use to reopen the database
@return null if everything is ok, error message otherwise
main/src/main/java/cgeo/geocaching/storage/DataStore.java