Question

I've installed the data migration tool (https://devdocs.magento.com/guides/v2.4/migration/migration-tool-configure.html).
Followed the steps to configure it by creating a separate module and everything works fine.
but from the looks of it, I need to keep the credentials to the magento 1 and magento 2 databases in the configuration file that I've cloned and modified from the tool code base.
This does not look like a valid approach if I want to version my config file. I rather not have the credentials available in a repo.
Is there an out of the box way of moving the credentials outside the config file?

Was it helpful?

Solution

The classes in the migration tool are instantiated via Object manager. This means they can be pluginized.

I ended up making an around plugin for each of the methods

  • Migration\Config::getSource()
  • Migration\Config::getDestination().

In these methods I read the Magento 1 db credentials from somewhere else and the magento 2 credentials from the env.php file of the instance where the migration tool is installed.

This way I can leave the credentials in the config file empty. But the tags have to be there, otherwise the migration tool complains

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top