Browse Source

SKIP_IMAGES_MIGRATION upgrade option

pull/9753/head
ViacheslavKlimov 3 years ago
parent
commit
3233d1b97e
  1. 7
      application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
  2. 1
      application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java

7
application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java

@ -271,6 +271,12 @@ public class ThingsboardInstallService {
case "3.6.1":
log.info("Upgrading ThingsBoard from version 3.6.1 to 3.6.2 ...");
databaseEntitiesUpgradeService.upgradeDatabase("3.6.1");
installScripts.loadSystemImages();
if (!getEnv("SKIP_IMAGES_MIGRATION", false)) {
installScripts.updateImages();
} else {
log.info("Skipping images migration. Run the upgrade with fromVersion as '3.6.2-images' to migrate");
}
//TODO DON'T FORGET to update switch statement in the CacheCleanupService if you need to clear the cache
break;
default:
@ -282,7 +288,6 @@ public class ThingsboardInstallService {
dataUpdateService.upgradeRuleNodes();
systemDataLoaderService.loadSystemWidgets();
installScripts.loadSystemLwm2mResources();
installScripts.loadSystemImages();
}
log.info("Upgrade finished successfully!");

1
application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java

@ -311,6 +311,7 @@ public class InstallScripts {
@SneakyThrows
public void loadSystemImages() {
log.info("Loading system images...");
Stream<Path> dashboardsFiles = Files.list(Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR));
try (dashboardsFiles) {
dashboardsFiles.forEach(file -> {

Loading…
Cancel
Save