Hi,

I am trying to migrate products from Magento 1 to Magento 2.

I have installed the data migration tool and created the config file as per the Magento guidelines however I get an error when trying to execute the migration command.

This is the error:

[Magento\Framework\Config\Dom\ValidationException]
Extra content at the end of the document
Line: 4

This is the config file contents:

<source> <database host="xx.xx.xx.x" name="magento_test" user="magento_test"/> </source> <destination> <database host="localhost" name="magento_test" user="magento_test"/> </destination> <options> <crypt_key>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx</crypt_key> </options>

There is no extra space after the destination tag, I have even tried putting all on one line and still gives the same extra content error.

Could I get some guidance on where I am going wrong please as the layout matches the example on the dev.magento site.

Thanks

Hi,

You need to check the next file location,
./vendor/magento/data-migration-tool/etc/ce-to-ce/1.9.2.2/config.xml

Check extra spaces, remove it and save a file. Also, I suggest to place code NOT in one line, it's easier to debug then.
Run again migration command.

You can also find a complete guide on Magento 1 to Magento 2 migration here.

Hope this helps.

Thank you,
Anastasia

Hi, it seems that you are having difficulty in migrating extension from magento version 1 to magento 2. This is the article I have read: https://www.mageplaza.com/blog/magento-1-to-magento-2-upgrade.html, it is quite helpful for your situation right now. Hope it helps you to migrate extension from magento version 1 to magento version 2. One last word: Magento is a great platform!

commented: it works to me. +0

The error you're encountering during the Magento 1 to Magento 2 data migration process, specifically the Magento\Framework\Config\Dom\ValidationException indicating "Extra content at the end of the document," suggests that there is likely an issue with the formatting or content of your XML configuration file. XML files can be quite sensitive to correct formatting, so even minor discrepancies can lead to errors.

Here are a few steps you can take to troubleshoot and resolve this issue:

XML Syntax Check: Ensure that your XML file is well-formed. This means checking for proper opening and closing tags, correct nesting of elements, and no stray characters outside of tags. Tools like online XML validators can be helpful in this regard.

Whitespace and Invisible Characters: Sometimes, invisible characters or additional whitespaces can cause issues. Make sure there are no extra spaces or line breaks at the end of the file. Consider using an advanced text editor that can show hidden characters.

File Encoding: Ensure that your XML file is saved with the correct encoding, typically UTF-8 without BOM (Byte Order Mark). Some text editors might add BOM, which can lead to parsing errors.

Schema Validation: Magento's data migration tool expects the XML file to follow a specific schema. Double-check that your file matches the structure and elements defined in Magento's documentation.

XML Closing Tags: Verify that all XML tags are properly closed. An unclosed tag could cause the parser to interpret the rest of the document as content of that tag.

Consult Magento Documentation: Review the Magento Data Migration Guide again to ensure that your configuration file adheres to their examples and recommendations.

Magento Community Forums: Sometimes, specific errors can be unique to certain setups. Checking Magento forums or communities might provide insights if others have encountered and resolved similar issues.

Backup and Environment Check: Ensure you have a backup of your Magento 1 database and that your Magento 2 environment is correctly set up and compatible with the data migration tool.

Version Compatibility: Check that the versions of Magento 1 and Magento 2 and the data migration tool are compatible.

Consult Magento Support or Experts: If the issue persists, consider reaching out to Magento support or a Magento expert, as they might have more insights specific to your setup.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.