Hey can anyone that have successfully changed encryption key helps me?
I tried changing encryption key on Magento but every time i did, our customer got logged out. (did this on staging/dev environment)
They can log in again and cart data and everything remains, but its very disruptive if this happens on production
Steps taken:
- Clone https://github.com/bemeir/magento2-rotate-encryption-keys
- run
php update-encryption.php scan
to get list of db tables with encoded values, this would generateencrypted-values.csv
with list of encrypted tables and encoded values - run
bin/magento encryption:key:change
- run
php update-encryption.php update-table --table={TABLE_NAME} --id-field=config_id --field=value --key={NEW_KEY} --key-index=1 --old-key-index=0 --dump=rotation.sql
with table names from #2 and the new key generated inenv.php
resulting changed/encoded table was only oauth_consumer
and core_config
table
Can anyone share if there’s any way i can keep my customer’s session after changing the encryption key?
Thank you in advance