Undefined array key "HTTP_HOST" error in CLI when export SIte

[25-Feb-2025 15:20:41 UTC] PHP Warning: Undefined array key “HTTP_HOST” in phar:///Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/wp-cli.phar/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1335) : eval()'d code on line 56

Do you have $_SERVER['HTTP_HOST'] somewhere in your wp-config.php (or perhaps elsewhere in your plugin/theme codebase)?

If so, you will need to give it a default value for use outside of server contexts (e.g. when you run WP-CLI) as it recommends in its docs:

When using $_SERVER['HTTP_HOST'] in your wp-config.php, you’ll need to set a default value in WP-CLI context:

if ( defined( 'WP_CLI' ) && WP_CLI && ! isset( $_SERVER['HTTP_HOST'] ) ) {
    $_SERVER['HTTP_HOST'] = 'example.com';
}