# Imported site with DB\_ param overrides in wp-config-env.php fails to connect to database

**URL:** https://community.kinsta.com/t/imported-site-with-db-param-overrides-in-wp-config-env-php-fails-to-connect-to-database/303
**Category:** Bug Reports
**Created:** [February 1, 2021, 4:21pm UTC](https://community.kinsta.com/t/imported-site-with-db-param-overrides-in-wp-config-env-php-fails-to-connect-to-database/303 "2021-02-01T16:21:02Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gfitech](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gfitech](https://community.kinsta.com/u/gfitech)
#### Post date: [February 1, 2021, 4:21pm UTC](https://community.kinsta.com/t/imported-site-with-db-param-overrides-in-wp-config-env-php-fails-to-connect-to-database/303/1 "2021-02-01T16:21:02Z")

</div>

**Q: Date/Time this occurred (Provide your time zone also)**  
**A:** 11:00 AM EST

**Q: DevKinsta Version**  
**A:** 1.0.1 (1.0.1.1173)

**Q: OS Version**  
**A:** macOS Catalina 10.15.7

**Q: Docker Desktop Version**  
**A:** 3.1.0 (51484)

**Q: Were any error codes or messages observed? If so, what were they?**  
**A:** Both WP Admin and Open site button showed “Fail to connect to database” messages

**Q: Detailed Description of the Problem**  
**A:** If your imported site has overrides to database params defined in wp-config-env.php, the Wordpress install in DevKinsta will fail to connect to the database because the DevKinsta install only updates credentials in the main wp-config.php file. As a workaround, I commented out the credentials in wp-config-env.php and was able to connect successfully - however, since we’d like to eventually use this tool to push changes to the live/staging Kinsta sites, commenting out that code for local development is not a viable workaround.

---

<div class="post-metadata">

### Author: ![michael](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/michael/32/31_2.png) [@michael](https://community.kinsta.com/u/michael)
#### Post date: [February 1, 2021, 8:28pm UTC](https://community.kinsta.com/t/imported-site-with-db-param-overrides-in-wp-config-env-php-fails-to-connect-to-database/303/2 "2021-02-01T20:28:11Z")

</div>

Hi @gfitech . Thanks for reporting this issue. To clarify, you have a custom configuration for `wp-config.php` and instead use `wp-config-env.php`?

---

<div class="post-metadata">

### Author: ![gfitech](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gfitech](https://community.kinsta.com/u/gfitech)
#### Post date: [February 1, 2021, 8:39pm UTC](https://community.kinsta.com/t/imported-site-with-db-param-overrides-in-wp-config-env-php-fails-to-connect-to-database/303/3 "2021-02-01T20:39:20Z")

</div>

Correct. We do use wp-config.php, but inside of wp-config.php, we check for the existence of “wp-config-env.php” and include\_once if it exists - in that file, we put all the config specific to our environment (as opposed to general config, which we do leave in wp-config.php). So even though the wp-config.php is updated to reflect the local environment in DevKinsta, it gets overridden by the config we have in wp-config-env.php and so the local site fails to connect.
