0

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?

4
  • The config file can be located anywhere : bin/magento migrate:data --auto /path/to/migration-config.xml
    – paj
    Feb 10 at 14:15
  • I know. But i also need this for development because i am not migrating only core data. I hace custom and third party extensions related data. So i need a part of it versioned and only the credentials stored somewhere else
    – Marius
    Feb 10 at 14:37
  • I guess you would have to modify the migration module to read the authentication data from a separate config file or data source.
    – paj
    Feb 10 at 16:47
  • I was keeping this as a backup measure. I hoped for some out of the box way of doing it. I guess I'll have to do that
    – Marius
    Feb 10 at 17:10
1

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

2
  • What about the crypt_key? Do you commit that to your repo, or do you save it together with your M1 db credentials in an unversioned file? Feb 10 at 17:42
  • Yes. That can be read from somewhere else also
    – Marius
    Feb 10 at 18:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.