Adobe Commerce:設定ファイルが見つからないか、変更されています

この記事では、環境に無い設定ファイルまたは変更された設定ファイルを解決する方法について説明します。

説明 description

環境

  • Adobe Commerce on cloud infrastructure

問題/症状

構成ファイル config.phpおよび/またはenv.phpが正しく変更されていないか、見つかりません。

解決策 resolution

デプロイメントプロセスでは、各設定ファイルのバックアップファイルを作成します。

  • app/etc/config.php.bak - システム固有の設定が含まれており、ビルド中に自動生成されます(存在しない場合)
  • app/etc/env.php.bak – 機密性の高い設定データが含まれています

ECE-tools backup:restore コマンドを使用して復元できます。 BAK ファイルは、デプロイメントプロセスによって生成されます。 デプロイメント後に設定ファイルを手動で変更した場合、変更内容は既存のBAK ファイルに反映されません。

設定ファイルを復元するには:

  1. SSHを使用してリモートリポジトリにログインします。

  2. 使用可能なバックアップファイルのリスト。

    code language-none
    ./vendor/bin/ece-tools backup:list
    
    code language-none
    The list of backup files:
                app/etc/env.php
                app/etc/config.php
    
  3. 設定ファイルを復元します。

    code language-none
    ./vendor/bin/ece-tools backup: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
    
  4. すべてのファイルを上書きするには、--force オプションを使用します。

    code language-none
    ./vendor/bin/ece-tools backup:restore --force
    
    code 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.
    
  5. オプションで、特定の設定ファイルを復元できます。

    code language-none
    ./vendor/bin/ece-tools backup:restore --force --file=app/etc/config.php
    
    code 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.
    
recommendation-more-help
experience-cloud-kcs-help-kbarticles