<p>You can prevent DDEV from writing to your project's .env file by <a href="https://ddev.readthedocs.io/en/stable/users/configuration/config/#disable_settings_management" rel="nofollow noreferrer">disabling settings management</a> in your <code>.ddev/config.yaml</code> file:</p>
<pre><code>disable_settings_management: true
</code></pre>

CC BY-SA 4.0
2024-08-30T12:22:40.883Z
thanks this is it!
after starting the container now DDEV says:

```Not creating CMS settings files because disable_settings_management=true```
ludo
CC BY-SA 4.0
2024-08-29T12:42:42.967Z
2024-08-29T12:42:42.967Z
Mats Mikkel Rummelhoff
<p>When DDEV starts, it writes some variables about the db settings in the .env file:</p>
<pre><code># Database connection settings
CRAFT_DB_DRIVER=&quot;mysql&quot;
CRAFT_DB_SERVER=&quot;db&quot;
CRAFT_DB_PORT=&quot;3306&quot;
CRAFT_DB_DATABASE=&quot;db&quot;
CRAFT_DB_USER=&quot;db&quot;
CRAFT_DB_PASSWORD=&quot;db&quot;
CRAFT_DB_SCHEMA=
CRAFT_DB_TABLE_PREFIX=
</code></pre>
<p>I have another database (a backup from prod) that I want Craft to use, and obviously when I set this in the env variable, it works. Unfortunately every time DDEV starts it overrides this variable, defaulting to &quot;db&quot;.</p>
<p>Is there any way to force this variable and disable the override?</p>

<database><craft4><environmentvariables><ddev>
Using a custom CRAFT_DB_DATABASE value at DDEV startup
# Using a custom CRAFT_DB_DATABASE value at DDEV startup

(Asked by: username_0 on 2024-08-29)

When DDEV starts, it writes some variables about the db settings in the .env file:
# Database connection settings
CRAFT_DB_DRIVER="mysql"
CRAFT_DB_SERVER="db"
CRAFT_DB_PORT="3306"
CRAFT_DB_DATABASE="db"
CRAFT_DB_USER="db"
CRAFT_DB_PASSWORD="db"
CRAFT_DB_SCHEMA=
CRAFT_DB_TABLE_PREFIX=

I have another database (a backup from prod) that I want Craft to use, and obviously when I set this in the env variable, it works. Unfortunately every time DDEV starts it overrides this variable, defaulting to "db".
Is there any way to force this variable and disable the override?

**Tags:** database, craft4, environmentvariables, ddev

---

## 1 answers

### Answer by username_1 on 2024-08-29. Score: 1 | Accepted answer

You can prevent DDEV from writing to your project's .env file by disabling settings management in your .ddev/config.yaml file:
disable_settings_management: true

> **Comments:**
> **username_0**: thanks this is it! after starting the container now DDEV says:  ```Not creating CMS settings files because disable_settings_management=true```  

---

