# Exporting Tag History on database from Edge Sync

**URL:** <https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265>\
**Category:** Ignition\
**Tags:** python, database, scripting, ignition81, perspective\
**Created:** [September 20, 2022, 5:25am UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265 "2022-09-20T05:25:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hayden](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@hayden](https://forum.inductiveautomation.com/u/hayden)\
**Post date:** [September 20, 2022, 5:25am UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265/1 "2022-09-20T05:25:02Z")

</div>

Hey all,

We have an Ignition Server, this is connected to an Ignition Edge that is syncing the data into our database.

We want to be able to export this raw data as a CSV, but we don’t want it to point to tags on the remote tag provider as the comms are not reliable and will fail as the tags disappear and as such don’t have any tags that can pull in using the `system.tag.queryTagHistory`

Strangely our power charts seem to display this data with no issue when no tags are there, but we don’t get anything if I use `system.tag.browseHistoricalTags(path).getResults()` when copying the setting from my power chart in as path.

How can we query the tag historian system to display this data in a set time range?

---

<div class="post-metadata">

**Author:** ![Beatriz\_Martinez](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Beatriz\_Martinez](https://forum.inductiveautomation.com/u/Beatriz_Martinez)\
**Post date:** [September 21, 2022, 5:35pm UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265/2 "2022-09-21T17:35:08Z")

</div>

Hi Hayden,

Are these tags ‘disappearing’ from the Tag Browser? or are they going to Bad Quality?

What property are you using system.tag.browseHistoricalTag() ?

---

<div class="post-metadata">

**Author:** ![hayden](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@hayden](https://forum.inductiveautomation.com/u/hayden)\
**Post date:** [September 22, 2022, 12:40am UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265/3 "2022-09-22T00:40:40Z")

</div>

We have this Edge as a remote tag provider, but often the comms will fail due to its location and tags all disappear when it does.  
We’re wanting a button to generate CSVs from our database, regardless of if the tags fail.

Because our power charts seem to work fine, I’ve been using the data field from the pens in my system.tag.browseHistoricalTag(), but it doesn’t seem to return anything when remote tag provider comms are down

---

<div class="post-metadata">

**Author:** ![Beatriz\_Martinez](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Beatriz\_Martinez](https://forum.inductiveautomation.com/u/Beatriz_Martinez)\
**Post date:** [September 23, 2022, 4:35pm UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265/4 "2022-09-23T16:35:40Z")

</div>

Hi Hayden,

What does the setting look like on your Gateway under Config \> Tag \> Real Time when clicking the edit button on the Tag Provider you are using under History Settings \> History Access Mode?

---

<div class="post-metadata">

**Author:** ![hayden](https://avatars.discourse-cdn.com/v4/letter/h/91b2a8/32.png) [@hayden](https://forum.inductiveautomation.com/u/hayden)\
**Post date:** [October 3, 2022, 2:19am UTC](https://forum.inductiveautomation.com/t/exporting-tag-history-on-database-from-edge-sync/64265/5 "2022-10-03T02:19:29Z")

</div>

Hey,  
We use database history for our tag provider
