ÃÛ¶¹ÊÓƵ

View and set admin configurations using the command line

A demonstration for how to view, set, and find config values with the Commerce CLI. Understand where the values are saved and also where the default values come from.

Who is this video for?

  • ÃÛ¶¹ÊÓƵ Commerce developers

Video content

Transcript
This is Russell with ÃÛ¶¹ÊÓƵ, and I’m going to show you how to reset the admin URI if you’ve logged into the admin and made a mistake and now you can’t log in. So for my example, the cloud project I’m on, it ends in slash admin for the admin path. And when I made the changes in the admin, it didn’t save right. And so now I get redirected to a 404. So if you made the same mistake, you can do what I did, which is use the ÃÛ¶¹ÊÓƵ Commerce Cloud CLI, and you can fix it and reset it back to its default value. So we’re going to take us to the terminal window and we’re going to SSH into our cloud project. And once we’re there, we’re going to run the command phpbin, then magento. I’m going to fix that. There we go. And it’s config colon set space and then the path. So it’s going to be admin slash URL slash and then use underscore custom. And we’re going to set that to zero. And once it’s done saving, there we go. We’re going to do the other value. So it’s going to be, just hit the up arrow to auto fill and we’re going to fix the last section. It’s going to be use custom underscore path. We’re going to set that to zero as well. Now, once that’s done saving, we’re going to go ahead and do the cache flush. So phpbin, magento, cache, colon type again, try that again. FLUSH. There we go. So now that we’re done, we can go to the front end and we can see what it looks like. So I’m going to go up and I’m going to type in my URL to my project and slash admin, which is the default value. And there you go. We’re fixed. So I hope this helps. Please continue to use experience league for your journey on your commerce education, as well as the other commerce and DX products.

Some commands used in the tutorial

Change the password security setting to recommended:

$ php bin/magento config:set admin/security/password_is_forced 0

Show the email address for the sales order auto copy functionality

$ php bin/magento config:show sales_email/order/copy_to

Show the empty result for a configuration that has a value in the admin

php bin/magento config:show trans_email/ident_sales/email

Mysql queries used in the tutorial

SELECT * FROM core_config_data WHERE path = 'sales_email/order/copy_to';

SELECT * FROM core_config_data WHERE path = 'sales_email/order_comment/copy_to';

SELECT * FROM core_config_data WHERE path = 'trans_email/ident_sales/email';

Where to find the default sales email

How to find the configuration value that is defined somewhere in codebase?
grep -rnw vendor/magento/ -e 'sales@example.com'

To view a page in terminal and show line numbers cat -n vendor/magento/module-email/etc/config.xml

Additional resources

recommendation-more-help
3a5f7e19-f383-4af8-8983-d01154c1402f