0

Because if I use that crypt_key from magento 1 and try to migrate another database, data-migration-tool runs and start to migrate that db.

Why is this happening?

What are the reasons to use that crypt_key?

1 Answer 1

1

crypt_key is used for encryption of sensitive information of site. eg. customer password When you migrate data from magento 1 to magento 2, you must need to define <crypt_key> field in config.xml file.

crypt_key convert encoded value of Magento 1 to value compatible with Magento2.

when you run migrate command, magento 2 data migration tool check data validation from Encrypt.php file, You can check file,

vendor/magento/data-migration-tool/src/Migration/Handler/Settings/Encrypt.php

Inside Handle() function you can check $this->validate($recordToHandle); function for validate of old data for crypt_key.

public function validate(Record $record)
    {
        if (empty($this->cryptKey)) {
            throw new Exception("\"crypt_key\" option is not defined the configuration.");
        }

        parent::validate($record);
    }

if you haven't defined crypt_key in config.xml file, data validatin throws error from above file.

So using crypt_key, Magento system use crypt key with encoding mechanism to encode sensitive information of users to store in db.
2
  • Means when I'm using crypt_key of magento 1 and start to migrate another DB then decryption of sensitive information is done using that crypt_key whose results are not usable. Thank You. Commented Mar 7, 2017 at 13:28
  • Yes its used for this purpose. Commented Mar 7, 2017 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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