# PostgreSQL Locating Lost historian data

**URL:** <https://forum.inductiveautomation.com/t/postgresql-locating-lost-historian-data/103148>\
**Category:** Ignition\
**Created:** [March 3, 2025, 2:25pm UTC](https://forum.inductiveautomation.com/t/postgresql-locating-lost-historian-data/103148 "2025-03-03T14:25:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jparsons](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jparsons](https://forum.inductiveautomation.com/u/jparsons)\
**Post date:** [March 3, 2025, 2:25pm UTC](https://forum.inductiveautomation.com/t/postgresql-locating-lost-historian-data/103148/1 "2025-03-03T14:25:05Z")

</div>

I had a client who changed a folder name in their tag browser breaking their entire project. What we ended up doing was changing over all of their data on the project to the new tag folder name (yes I know we did it the hard way).

The problem is that they lost their historical data prior to when the original guy changed the folder name. I thought that I could just go to the original folder in the tag tree and the original tags would all be there (now reading 0s) but it would still be there. Turns out there are no tags in that folder anymore. I was going to go into PG Admin and see if I could locate the old database, if it is still there, and pull the data back with a SQL query into ignition but I have been told that is a lot easier said than done. Is there some sort of guide on how Ignition sets up their historical databases?

---

<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:** [March 3, 2025, 2:30pm UTC](https://forum.inductiveautomation.com/t/postgresql-locating-lost-historian-data/103148/2 "2025-03-03T14:30:33Z")

</div>

You'll have to lookup the old tag paths in the historian's metadata tables to find the old tag IDs. And the corresponding tag IDs for the new tag paths. Then alter the metadata to make the old tag IDs belong to the new tag paths, but "retired".

(Non-trivial. Study [the documented schema](https://www.docs.inductiveautomation.com/docs/8.1/appendix/reference-pages/ignition-database-table-reference) before you do this, and make sure you have a good DB backup.)

After you alter the raw data in the database, you will need to restart the gateway for the historian to pick up all of your changes.

---

<div class="post-metadata">

**Author:** ![jparsons](https://avatars.discourse-cdn.com/v4/letter/j/ea666f/32.png) [@jparsons](https://forum.inductiveautomation.com/u/jparsons)\
**Post date:** [March 3, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/postgresql-locating-lost-historian-data/103148/3 "2025-03-03T15:24:57Z")

</div>

> [@pturmel](#):
>
> he old tag IDs. And the corresponding tag IDs for the new tag paths. Then alter the metadata to make the old tag IDs belong to the new tag paths, but "retired".

Thanks! I will give that a try!
