# Startup Script assign default db connection

**URL:** <https://forum.inductiveautomation.com/t/startup-script-assign-default-db-connection/61330>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [June 29, 2022, 12:19am UTC](https://forum.inductiveautomation.com/t/startup-script-assign-default-db-connection/61330 "2022-06-29T00:19:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Newton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniel_newton/32/36158_2.png) [@Daniel\_Newton](https://forum.inductiveautomation.com/u/Daniel_Newton)\
**Post date:** [June 29, 2022, 12:19am UTC](https://forum.inductiveautomation.com/t/startup-script-assign-default-db-connection/61330/1 "2022-06-29T00:19:49Z")

</div>

Hi All,  
Obligatory first post declaration. English is my first language, so please judge accordingly.

I have a gateway that is being developed in a testing OU that is air gapped from all production environments.  
For shakedown tests it would be great to use my location settings to drop a read only gateway into production so we can see how our UDTs and trends hold up.

I am hoping somebody can help with some nomenclature to set the default db connection for a given project. something along the lines of _system.db.setdefaultconnection_ would do the trick or any alternate path to get there.

TIA

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 29, 2022, 12:29am UTC](https://forum.inductiveautomation.com/t/startup-script-assign-default-db-connection/61330/2 "2022-06-29T00:29:40Z")

</div>

There's no such trick. But:

> [@Daniel\_Newton](#):
>
> air gapped from all production environments.

So, set up a DB in that environment with identical content. Let you test system write to it. If you are pedantic enough, you will set up DNS and/or IP addresses identically as well, allowing you to simply drop in a gateway backup.

> [@Daniel\_Newton](#):
>
> English is my first language, so please judge accordingly.

Hah! We're geeks. Communication skills are sometimes lacking. /:

---

<div class="post-metadata">

**Author:** ![Daniel\_Newton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniel_newton/32/36158_2.png) [@Daniel\_Newton](https://forum.inductiveautomation.com/u/Daniel_Newton)\
**Post date:** [June 29, 2022, 12:39am UTC](https://forum.inductiveautomation.com/t/startup-script-assign-default-db-connection/61330/3 "2022-06-29T00:39:58Z")

</div>

Thanks.  
Unfortunately the test environment mimics the production env. DNS/IP and server names are unique.  
DEVPCSIGN01.domain1.local vs SITPCSIGN01.domain1.local  
I have control over the db name, so in theory on startup I can update the db connection URL and define a single db connection, but I feel like there might be some friction using different windows service accounts and winAuth connections.
