Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Settings Failing XSD Validation Opensource-to-Opensource #695

Closed
PivitParkour94 opened this issue Jun 18, 2019 · 4 comments
Closed

Comments

@PivitParkour94
Copy link

Preconditions

  1. Magento 2.3.1

  2. PHP 7.2.19

  3. mysql --version

      mysql  Ver 15.1 Distrib 10.2.24-MariaDB, for Linux (x86_64) using readline 5.1
    
  4. CentOS Linux release 7.6.1810 (Core)

Steps to reproduce

  1. Install data migration tool <composer require magento/data-migration-tool:2.3.1> on existing, working Magento 2.3.1 installation
  2. cp ./vendor/magento/data-migration-tool/etc/opensource-to-opensource/settings.xml.dist ./vendor/magento/data-migration-tool/etc/opensource-to-opensource/settings.xml
  3. bin/magento -vvv migrate:settings ./vendor/magento/data-migration-tool/etc/opensource-to-opensource/settings.xml

Expected result

  1. [INFO]: Migration completed

Actual result

  1. Exception is thrown "XML file is invalid"

Additional notes

After adding the following verbose logging changes:

    try {
        $isValid = $document->validate($this->getConfigDirectoryPath() . self::CONFIGURATION_SCHEMA, $errors);
    } catch (\Exception $exception) {
        throw new Exception('XML file is invalid at ' . $configFile);
    }
    if (!$isValid) {
        throw new Exception('XML file is invalid at ' . $configFile . '<br>' . json_encode($errors));
    }

The error being thrown was that the config.xsd wasn't validating.
After adding a little switch statement and a constant for the settings.xsd the error was resolved.

Should I make a pull request for this? I don't want to put in the effort if it is just going to be ignored.

If this isn't replicatable, we can maintain our own version with the patch, but obviously a PR into the actual codebase would be better.

Possibly related issues
#546 [Migration\Exception] XML file is invalid. 1.9.3.8 -> 2.2.4
#378 Magento2 Migrating from M1 1.9.3.6 To M2 2.2.0 opensource to opensource

It's a little sad to see that the solution to the validation failing is to simply move change to a development environment...

@victor-v-rad
Copy link
Collaborator

Hi @PivitParkour94

Thank you for reporting this issue and willing to make a pull request to fix it. It will be processed for sure.

@victor-v-rad
Copy link
Collaborator

Or if you do not have much time, you can just put the solution here and I will make according changes to the code of the tool.

PivitParkour94 added a commit to PivitParkour94/data-migration-tool that referenced this issue Jun 20, 2019
…tch statement to validate config/settings files correctly. Increased the error output to help with debugging. As this is a CLI tool, I can't see any issues with have more verbose output.
@PivitParkour94
Copy link
Author

Misread the documentation. Weird that using the settings file directly acted as though it worked.

@victor-v-rad
Copy link
Collaborator

@PivitParkour94 Yeah, at first glance using settings.xml in migrate:settings command seems quite reasonable. I really appreciate your time and willing to make a contribution anyway. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants