diff --git a/files/custom/Espo/Modules/DataMigration/Services/ImportService.php b/files/custom/Espo/Modules/DataMigration/Services/ImportService.php index 4f6ef73..0ec5a1d 100644 --- a/files/custom/Espo/Modules/DataMigration/Services/ImportService.php +++ b/files/custom/Espo/Modules/DataMigration/Services/ImportService.php @@ -100,6 +100,11 @@ class ImportService continue; } + if (!$this->entityTypeExists($entityType)) { + $io->writeLine("Skipping {$entityType} (module not installed)"); + continue; + } + $io->writeLine("Importing {$entityType}..."); $result = $this->entityImporter->import( @@ -171,4 +176,14 @@ class ImportService } } } + + private function entityTypeExists(string $entityType): bool + { + try { + $this->entityManager->getRDBRepository($entityType); + return true; + } catch (\Exception $e) { + return false; + } + } }