# How to create new container connecting to existing database?

**URL:** <https://forum.mautic.org/t/how-to-create-new-container-connecting-to-existing-database/15316>\
**Category:** Product Support\
**Created:** [July 21, 2020, 3:21pm UTC](https://forum.mautic.org/t/how-to-create-new-container-connecting-to-existing-database/15316 "2020-07-21T15:21:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielhilst](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/danielhilst/32/2132_2.png) [@danielhilst](https://forum.mautic.org/u/danielhilst)\
**Post date:** [July 21, 2020, 3:21pm UTC](https://forum.mautic.org/t/how-to-create-new-container-connecting-to-existing-database/15316/1 "2020-07-21T15:21:48Z")

</div>

**Your software**  
My Mautic version is: mautic/mautic:latest (2.16)  
My PHP version is: 7.3

**Your problem**  
My problem is: I have an existing database and suppose that I lost the container connected to it. When creating a new container it invokes the installer but I want it to connect directly to existing database. How to achieve that?

I know that there is a volume mounted at `/var/www/html` in the container where the mautic resides, there must be something there that persist the database configuration, if I can add this configuration it would connect without invoking the installer, any help is appreciated

Cheers,

---

<div class="post-metadata">

**Author:** ![danielhilst](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/danielhilst/32/2132_2.png) [@danielhilst](https://forum.mautic.org/u/danielhilst)\
**Post date:** [July 21, 2020, 5:56pm UTC](https://forum.mautic.org/t/how-to-create-new-container-connecting-to-existing-database/15316/2 "2020-07-21T17:56:56Z")

</div>

Okay I got somewhere, the file that is changed is app/config/local.php

where is a obfuscated patch before and after running the installer

```
--- local.php.orig	2020-07-21 17:50:49.958729000 +0000
+++ local.php	2020-07-21 17:52:52.052044000 +0000
@@ -7,4 +7,22 @@
   'db_user' => 'root',
   'db_password' => 'xxxxxxxx',
   'default_timezone' => 'UTC',
+	'db_table_prefix' => null,
+	'db_port' => '3306',
+	'db_backup_tables' => 1,
+	'db_backup_prefix' => 'bak2_',
+	'db_server_version' => '5.7.29-32',
+	'mailer_from_name' => 'Daniel Hilst',
+	'mailer_from_email' => 'admin@example.com',
+	'mailer_transport' => 'mail',
+	'mailer_host' => null,
+	'mailer_port' => null,
+	'mailer_user' => null,
+	'mailer_password' => null,
+	'mailer_encryption' => null,
+	'mailer_auth_mode' => null,
+	'mailer_spool_type' => 'memory',
+	'mailer_spool_path' => '%kernel.root_dir%/spool',
+	'secret_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxx',
+	'site_url' => 'http://localhost:8080',
 );
```
