diff --git a/dotCMS/src/main/java/com/dotmarketing/util/starter/ImportStarterUtil.java b/dotCMS/src/main/java/com/dotmarketing/util/starter/ImportStarterUtil.java index 8b2c86a0d98..967a02ab356 100644 --- a/dotCMS/src/main/java/com/dotmarketing/util/starter/ImportStarterUtil.java +++ b/dotCMS/src/main/java/com/dotmarketing/util/starter/ImportStarterUtil.java @@ -105,13 +105,7 @@ public class ImportStarterUtil { * Fully configurable path for the backup directory. */ private static final String BACKUP_DIRECTORY = ConfigUtils.getBackupPath(); - /* - * Unique identifier for the replica. This is used to create a unique directory for the replica. - * If the HOSTNAME environment variable is set, it will be used. Otherwise, a random UUID will be used. - * */ - private static final String REPLICA_ID = System.getenv().getOrDefault("HOSTNAME", UUID.randomUUID().toString()); - - private String backupTempFilePath = BACKUP_DIRECTORY + File.separator + REPLICA_ID + File.separator + "temp"; + private String backupTempFilePath = BACKUP_DIRECTORY + File.separator + "temp"; private ArrayList classesWithIdentity = new ArrayList<>(); private Map sequences; private Map tableIDColumns; @@ -957,7 +951,7 @@ public boolean validateZipFile() { String tempDirPath = getBackupTempFilePath(); if (starterZip == null || !starterZip.exists()) { - throw new DotStateException("Starter.zip does not exist:" + starterZip); + throw new DotStateException("Starter.zip does not exist: " + starterZip); } try { @@ -975,18 +969,16 @@ public boolean validateZipFile() { } } - Path tempZipPath = tempDir.resolve(starterZip.getName()); - - // Copy the starter zip to the temp directory - Files.copy(starterZip.toPath(), tempZipPath, StandardCopyOption.REPLACE_EXISTING); - - // Unzip the file if it is a valid zip + // Extract the zip file contents into the temp directory if (starterZip.getName().toLowerCase().endsWith(".zip")) { try (ZipFile zipFile = new ZipFile(starterZip)) { ZipUtil.extract(zipFile, tempDir.toFile()); } } + // Process the extracted contents (if needed) + Logger.info(this, String.format("Successfully processed starter.zip in: %s", tempDir)); + return true; } catch (IOException e) { throw new DotStateException("Error processing starter.zip: " + e.getMessage(), e);