public void backup(final Runnable runAfterwards, final boolean autobackup) {
        final List<ContentStorage.FileInformation> dirs = getDirsToRemove(autobackup ? MAX_AUTO_BACKUPS : Settings.allowedBackupsNumber(), autobackup);
        if (dirs != null) {
            if (autobackup) {
                removeDirs(dirs);
                backupInternal(runAfterwards, true);
            } else {
                Dialogs.advancedOneTimeMessage(activityContext, OneTimeDialogs.DialogType.DATABASE_CONFIRM_OVERWRITE, activityContext.getString(R.string.init_backup_backup), activityContext.getString(R.string.backup_confirm_overwrite, getBackupDateTime(dirs.get(dirs.size() - 1).dirLocation)), null, true, null, () -> {
                    removeDirs(dirs);
                    backupInternal(runAfterwards, false);
                });
            }
        } else {
            backupInternal(runAfterwards, autobackup);
        }
    }
Create a backup after confirming to overwrite the existing backup.
main/src/main/java/cgeo/geocaching/utils/BackupUtils.java