private function installShopData($database, $demoDataRequired = 0)
    {
        $baseSqlDir = $this->getUtilitiesInstance()->getSqlDirectory(EditionSelector::COMMUNITY);

        try {
            // If demo data files are provided.
            if ($demoDataRequired && $this->getUtilitiesInstance()->isDemodataPrepared()) {
                $this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();

                // Install demo data.
                $database->queryFile($this->getUtilitiesInstance()->getActiveEditionDemodataPackageSqlFilePath());
                // Copy demo data files.
                $this->getUtilitiesInstance()->executeExternalDemodataAssetsInstallCommand();
            } else {
                $database->queryFile("$baseSqlDir/initial_data.sql");

                $this->getUtilitiesInstance()->executeExternalDatabaseMigrationCommand();
            }
        } catch (Exception $exception) {
            $commandException = new CommandExecutionFailedException('Migration', $exception->getCode(), $exception);
            $commandException->setCommandOutput([$exception->getMessage()]);

            $this->handleCommandExecutionFailedException($commandException);

            throw new SetupControllerExitException();
        }
    }