@Override public void upgradeProject() throws IOException { //let's check if we have legacy config directories, then we copy them to their new places, and rename the previous ones as .old Path entityConfigDir = this.projectDir.resolve("entity-config"); Path hubInternalConfigDir = this.projectDir.resolve("hub-internal-config"); Path userConfigDir = this.projectDir.resolve("user-config"); //and now what we want to name the old directories so they're not copied over again in another update Path oldEntityConfigDir = this.projectDir.resolve("entity-config.old"); Path oldHubInternalConfigDir = this.projectDir.resolve("hub-internal-config.old"); Path oldUserConfigDir = this.projectDir.resolve("user-config.old"); //obsolete database/server/role names in hub-internal-config from 3.0 Set<String> obsoleteFiles = Stream.of("trace-database.json", "triggers-database.json", "schemas-database.json", "trace-server.json", "data-hub-role.json").collect(Collectors.toSet()); //if the entity-config directory exists, we'll copy it to the src/main/entity-config upgradeProjectDir(entityConfigDir, getEntityConfigDir(), oldEntityConfigDir); upgradeHubInternalConfig(hubInternalConfigDir, oldHubInternalConfigDir, obsoleteFiles ); upgradeUserConfig(userConfigDir, oldUserConfigDir, obsoleteFiles); /*If the upgrade path is 3.0 -> 4.0.x -> 4.1.0 or 4.0.0 -> 4.1.0, the obsolete files have to be removed, * else, they will cause deployment to fail */ deleteObsoleteDatabaseFilesFromHubInternalConfig(); deleteObsoleteServerFilesFromHubInternalConfig(); deleteObsoleteDatabaseFilesFromMlConfig(); }