# \[IGN-2684\]Import / Export tag group settings

**URL:** <https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771>\
**Category:** Ignition\
**Created:** [May 19, 2022, 7:20am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771 "2022-05-19T07:20:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![reto.kunz](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@reto.kunz](https://forum.inductiveautomation.com/u/reto.kunz)\
**Post date:** [May 19, 2022, 7:20am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/1 "2022-05-19T07:20:03Z")

</div>

Is there a way to import / export tag group settings via scripting?  
I want to add these settings to an automated tag import/export when using a git workflow - they are easily forgotten when setting up a project.

In the designer there is a possibility to import and export these settings to a JSON file, however I can not find any commands in the scripting library. (e.g. Like system.tag.exportTags).

Are they somehow accessible through the SDK? E.g.with TagProvider.getTagGroupsAsync()?  
Or is there an easier way to directly trigger a JSON export / import?

---

<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:** [May 19, 2022, 4:26pm UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/2 "2022-05-19T16:26:51Z")

</div>

It’s probably doable through the SDK, but there’s no readily accessible, supported method to do so (yet) that you’re missing. I’ve added this thread to our internal ticket requesting the feature.

---

<div class="post-metadata">

**Author:** ![reto.kunz](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@reto.kunz](https://forum.inductiveautomation.com/u/reto.kunz)\
**Post date:** [May 20, 2022, 6:44am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/3 "2022-05-20T06:44:48Z")

</div>

I managed to build a simple export / import function using the SDK.  
We can get the individual tag group configs and serialize them into a file. For the import they can be deserialized and loaded back to the tag providers.

However I am aware that this is not supported and might cause problems with future versions.

> [@paul-griffith](#):
>
> I’ve added this thread to our internal ticket requesting the feature.

Thank you, having an officially supported way to achieve this would be really helpful.

Here is the export code as an example:  
(if anyone wants to build something similar, do not forget to add proper error handling)

```auto
from com.inductiveautomation.ignition.gateway import IgnitionGateway
from com.inductiveautomation.ignition.common.tags.config import TagGroupConfiguration
from java.io import ObjectOutputStream, FileOutputStream
	
EXPORT_PATH = "C://yourpath/"
EXPORT_FILENAME = "TagGroupExport.txt"
logger = system.util.getLogger("myLogger")
context = IgnitionGateway.get()

tagManager = context.getTagManager()
providerNames = tagManager.getTagProviderNames()
logger.info("Provider Names " + str(providerNames))
	
for name in providerNames:
	provider = tagManager.getTagProvider(name)
	tagGroupsConfig = provider.getTagGroupsAsync().get()
	logger.info("Exported TagGroups: " + str(tagGroupsConfig))
	
	f=FileOutputStream(EXPORT_PATH + name + EXPORT_FILENAME)
	o = ObjectOutputStream(f)
	o.writeObject(tagGroupsConfig)
	logger.info("Tag Groups " + name + " Exported")

```

---

<div class="post-metadata">

**Author:** ![jogam](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jogam](https://forum.inductiveautomation.com/u/jogam)\
**Post date:** [August 9, 2022, 9:20pm UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/4 "2022-08-09T21:20:03Z")

</div>

@paul-griffith : is tag group import/export via system.tag.\* library something that might materialize in soon-ish ignition releases? Thanks!

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [November 14, 2022, 11:59am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/5 "2022-11-14T11:59:40Z")

</div>

+1 for this feature for 8.1, import will be very useful !

@paul-griffith, perhaps a feature for:

> [@Ignition Extensions - Convenience utilities for advanced users](https://forum.inductiveautomation.com/t/ignition-extensions-convenience-utilities-for-advanced-users/64615):
>
> Introducing a hopefully community-engaged effort to build a useful repository of scripting and other Ignition utilities for everyone to benefit from. Download the latest release from the [Releases](https://github.com/IgnitionModuleDevelopmentCommunity/ignition-extensions/releases) page and take advantage of the following functions: Scripting Functions system.util system.util.getContext(): Context A convenience function to retrieve the local "context" object, useful as an entrypoint to other advanced scripting. system.util.deepCopy(object): Object Converts a given Pyth…

---

<div class="post-metadata">

**Author:** ![apurva\_mishra](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@apurva\_mishra](https://forum.inductiveautomation.com/u/apurva_mishra)\
**Post date:** [April 1, 2024, 11:57pm UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/6 "2024-04-01T23:57:15Z")

</div>

Any traction on this feature? Would love to use it in conjunction with system.tag.exportTags for git ☹

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 2, 2024, 5:46am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/7 "2024-04-02T05:46:14Z")

</div>

The OP already provided a way to do it using the sdk, any reason you can't use that?

---

<div class="post-metadata">

**Author:** ![apurva\_mishra](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@apurva\_mishra](https://forum.inductiveautomation.com/u/apurva_mishra)\
**Post date:** [April 2, 2024, 6:04am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/8 "2024-04-02T06:04:36Z")

</div>

Haven't used sdk to build our own modules, let me look into it.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 2, 2024, 6:13am UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/9 "2024-04-02T06:13:05Z")

</div>

No need to build a module, just need to copy and paste the code into a gateway scoped script area. By 'sdk' we're really talking about the [javadocs](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.29/index.html)

---

<div class="post-metadata">

**Author:** ![Mehdi\_MECHEDAL](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@Mehdi\_MECHEDAL](https://forum.inductiveautomation.com/u/Mehdi_MECHEDAL)\
**Post date:** [September 5, 2024, 12:26pm UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/10 "2024-09-05T12:26:54Z")

</div>

Hello,

Based on @reto.kunz code i made a code that do exactly the same than Group Tags Export.

```python
logger = system.util.getLogger("GatewayEvent.Scripts.Update")

from com.inductiveautomation.ignition.gateway import IgnitionGateway
from com.inductiveautomation.ignition.common.tags.config import TagGroupConfiguration
import json

context = IgnitionGateway.get()
tagManager = context.getTagManager()

#I am working in project named edge
provider = tagManager.getTagProvider("edge")

tagGroupsConfig = edgeProvider.getTagGroupsAsync().get()

tagGroupsConfigExport = []

for tagGroupConfig in tagGroupsConfig:
	
	configs = tagGroupConfig.getConfig()
	
	tagGroupConfigExport = {}
	
	for config in configs:
		if isinstance(config.getValue(), (int, bool, float)):
			tagGroupConfigExport[str(config.getProperty())] = config.getValue()
		else:
			tagGroupConfigExport[str(config.getProperty())] = str(config.getValue())
	
	tagGroupsConfigExport.append(tagGroupConfigExport)
	
jsonTagGroupsConfig = json.dumps(tagGroupsConfigExport, indent=4, sort_keys=True)
#jsonTagGroupsConfig = system.util.jsonEncode({"list": tagGroupsConfigExport}, 4)

system.file.writeFile("data\\projects\\tagGroups.json", jsonTagGroupsConfig) 

```

My code is executed when my project is saved (Gateway Event Update) in order to save in git every modification.

---

<div class="post-metadata">

**Author:** ![Patrick\_Mannion](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/patrick_mannion/32/72598_2.png) [@Patrick\_Mannion](https://forum.inductiveautomation.com/u/Patrick_Mannion)\
**Post date:** [February 12, 2025, 5:16pm UTC](https://forum.inductiveautomation.com/t/ign-2684-import-export-tag-group-settings/59771/11 "2025-02-12T17:16:18Z")

</div>

> [@reto.kunz](#):
>
> ```python
> from com.inductiveautomation.ignition.gateway import IgnitionGateway
> from com.inductiveautomation.ignition.common.tags.config import TagGroupConfiguration
> from java.io import ObjectOutputStream, FileOutputStream
> 	
> EXPORT_PATH = "C://yourpath/"
> EXPORT_FILENAME = "TagGroupExport.txt"
> logger = system.util.getLogger("myLogger")
> context = IgnitionGateway.get()
> 
> tagManager = context.getTagManager()
> providerNames = tagManager.getTagProviderNames()
> logger.info("Provider Names " + str(providerNames))
> 	
> for name in providerNames:
> provider = tagManager.getTagProvider(name)
> tagGroupsConfig = provider.getTagGroupsAsync().get()
> logger.info("Exported TagGroups: " + str(tagGroupsConfig))
> 	
> f=FileOutputStream(EXPORT_PATH + name + EXPORT_FILENAME)
> o = ObjectOutputStream(f)
> o.writeObject(tagGroupsConfig)
> logger.info("Tag Groups " + name + " Exported")
> 
> ```

Great find, thanks Mehdi. This is a big help with docker-based automation for developer environments
