# Any 'configuration' tools to set up different connections based on configuration

**URL:** <https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099>\
**Category:** Ignition\
**Created:** [March 4, 2021, 2:28pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099 "2021-03-04T14:28:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sydney.bergeron](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sydney.bergeron](https://forum.inductiveautomation.com/u/sydney.bergeron)\
**Post date:** [March 4, 2021, 2:28pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/1 "2021-03-04T14:28:27Z")

</div>

We just purchased a second Ignition license to do development work on without disturbing our production instance.

I know we can install a ‘backup’ of the production instance onto this development gateway to get a duplicate and work from there. But is there any way to create configurations for a gateway?  
As in, if the configuration is development, point to these databases, and if it’s production, point to these?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 4, 2021, 5:33pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/2 "2021-03-04T17:33:49Z")

</div>

Not really. A strategy that can work well is to set up local DNS, so that you can refer to any external dependencies (DB, network shares, etc) by a particular hostname. Then you just need to make sure the appropriate DNS entries are present in both environments, and can freely send backups back and forth.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 4, 2021, 5:45pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/3 "2021-03-04T17:45:27Z")

</div>

[This thread](http://forum.inductiveautomation.com/t/good-way-to-make-sure-my-gateway-scripts-only-run-on-the-server/33777) discusses approaches you might take in scripting if the environment you run in matters.

---

<div class="post-metadata">

**Author:** ![sydney.bergeron](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sydney.bergeron](https://forum.inductiveautomation.com/u/sydney.bergeron)\
**Post date:** [March 15, 2021, 4:40pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/4 "2021-03-15T16:40:24Z")

</div>

@paul-griffith @Kevin.Herron

Thanks for the link to the thread discussing scripting & configuration. That will be useful.

The local DNS solution for our external connections isn’t ideal for us.  
As far as gateway backups go, is there any way to export portions of a gateway (similar to how you can export pieces of a project)?  
That way I can exclude DB connections from the backup restore.

---

<div class="post-metadata">

**Author:** ![sydney.bergeron](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sydney.bergeron](https://forum.inductiveautomation.com/u/sydney.bergeron)\
**Post date:** [March 16, 2021, 3:51pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/5 "2021-03-16T15:51:00Z")

</div>

@paul-griffith What about using system.db.setDatasourceConnectURL in a gateway startup script? (using environment variables to determine connection URL)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 16, 2021, 3:54pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/6 "2021-03-16T15:54:17Z")

</div>

> [@sydney.bergeron](#):
>
> As far as gateway backups go, is there any way to export portions of a gateway (similar to how you can export pieces of a project)?

No, not at present. A better strategy for 'partial' gateway backup and restore is something we're considering, but no timelines.

> [@sydney.bergeron](#):
>
> @paul-griffith What about using system.db.setDatasourceConnectURL in a gateway startup script? (using environment variables to determine connection URL)

Yes, that would certainly work. I'm not sure I would _necessarily_ advise for or against it - it's going to be somewhat tricky to unpack where it's happening. Also, gateway startup scripts are scoped inside a project, so someone could disable a project and inadvertently cause you to work against the wrong DB.

---

<div class="post-metadata">

**Author:** ![sydney.bergeron](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sydney.bergeron](https://forum.inductiveautomation.com/u/sydney.bergeron)\
**Post date:** [March 16, 2021, 4:00pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/7 "2021-03-16T16:00:35Z")

</div>

Gotcha. I could certainly see it being lost in obscurity and then running into issues if someone doesn’t know what they are doing.  
I’ll keep that in mind and see if we can have some process controls around that to make it more difficult.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@peter](https://forum.inductiveautomation.com/u/peter)\
**Post date:** [March 16, 2021, 4:10pm UTC](https://forum.inductiveautomation.com/t/any-configuration-tools-to-set-up-different-connections-based-on-configuration/44099/8 "2021-03-16T16:10:47Z")

</div>

> [@sydney.bergeron](#):
>
> @PGriffith @Kevin.Herron  
> The local DNS solution for our external connections isn't ideal for us.

Its not clear if you are using a fully qualified domain name for your resources, but if you are then instead of a local DNS, how about a local Hosts file on just the Dev machines? The Hosts file would map the resources to the IPs of your test DBs, and because you don't put it on your production machine then no re-mapping occurs there.
