fix(upgrade): Ensure that `$CONFIG` is always available to upgrade scripts

Fixes #7457
Merge pull request #7460 from ewinslow/fix-install-upgrade

fix(upgrade): Ensure that `$CONFIG` is always available to upgrade scripts