private void removeOldVersions() throws Exception {
logger.log(Level.INFO, "START TX removeOldVersions() ...");
Map<FileHistoryId, FileVersion> purgeFileVersions = new HashMap<>();
this.remoteTransaction = new RemoteTransaction(config, transferManager);
purgeFileVersions.putAll(localDatabase.getFileHistoriesWithMaxPurgeVersion(options.getKeepVersionsCount()));
purgeFileVersions.putAll(localDatabase.getDeletedFileVersions());
boolean purgeDatabaseVersionNecessary = purgeFileVersions.size() > 0;