Adobe Commerce: Missing or altered configuration file
This article describes how to resolve missing or altered configuration files.
Description description
Environment
- Adobe Commerce on cloud infrastructure
Issue/Symptoms
Configuration files config.php and/or env.php were incorrectly changed or are missing.
Resolution resolution
The deployment process creates a backup file for each configuration file:
app/etc/config.php.bak- contains system-specific settings and is auto-generated during build if it does not existapp/etc/env.php.bak- contains sensitive configuration data
You can restore them using the ECE-tools backup:restore command. The BAK files are generated by the deployment process. If you manually change a configuration file after the deployment, your changes are not reflected in the existing BAK files.
To restore the configuration files:
-
Log in to your remote repository using SSH.
-
List the available backup files.
code language-none ./vendor/bin/ece-tools backup:listcode language-none The list of backup files: app/etc/env.php app/etc/config.php -
Restore the configuration files.
code language-none ./vendor/bin/ece-tools backup:restoreYou receive a list of the existing configuration files affected by the restore.
code language-none app/etc/env.php file exists! If you want to rewrite existed files use --force app/etc/config.php file exists! If you want to rewrite existed files use --force -
Use the
--forceoption to overwrite all files.code language-none ./vendor/bin/ece-tools backup:restore --forcecode language-none Command backup:restore with option --force will rewrite your existed files. Do you want to continue [ y/N] ?y Backup file app/etc/env.php was restored. Backup file app/etc/config.php was restored. -
Optionally, you can restore a specific configuration file.
code language-none ./vendor/bin/ece-tools backup:restore --force --file=app/etc/config.phpcode language-none Command backup:restore with option --force will rewrite your existed files. Do you want to continue [ y/N] ?y Backup file app/etc/config.php was restored.