# When are DB tables automatically created?

**URL:** <https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089>\
**Category:** Ignition\
**Tags:** ignition79, database\
**Created:** [August 17, 2017, 2:03am UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089 "2017-08-17T02:03:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [August 17, 2017, 2:03am UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/1 "2017-08-17T02:03:18Z")

</div>

I’m backing up and restoring a full solution spanning multiple server machines onto a new site. The plan is to deploy this solution and simply change some of the networking info for the new site. At the new site, I want to just delete all the tables in the database and let the new Ignition instance recreate tables to store all of the new site’s data.

So, the question is, what exactly triggers the feature in ignition whereby it automatically populates a database with tables? On learning this, I will delete all the existing tables in the database on the restored SQL server and trigger repopulation from ignition.

Thanks,  
Zac Slade

---

<div class="post-metadata">

**Author:** ![tyler.bennett](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@tyler.bennett](https://forum.inductiveautomation.com/u/tyler.bennett)\
**Post date:** [May 11, 2018, 3:25pm UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/2 "2018-05-11T15:25:47Z")

</div>

Did you find an answer to this? I’m troubleshooting an issue where the database tables were not created at all, despite having a valid database connection. I saw some posts that seemed to indicate the tables may get created when the module was restarted but that did not work for me.

---

<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 11, 2018, 3:34pm UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/3 "2018-05-11T15:34:11Z")

</div>

Assuming this is all referring to the Tag Historian modules created tables (`sqlth_` or `sqlt_data_` prefix) then the tables will be recreated as soon as any source of historical data actually _sends_ data to the tag history provider. Tag history providers are automatically created 1:1 with database connections - so as soon as any scan class fires to store history on a new DB the tables will be automatically generated.

---

<div class="post-metadata">

**Author:** ![tyler.bennett](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@tyler.bennett](https://forum.inductiveautomation.com/u/tyler.bennett)\
**Post date:** [May 11, 2018, 4:24pm UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/4 "2018-05-11T16:24:11Z")

</div>

That does not seem to have happened for me, tables are not created despite having a valid database connection and many tags configured to push history to this database.  
I have posted a new topic here (link below) so as not to confuse this topic and the intent of the original poster. I would appreciate further feedback from you.

> [@Database Tables not Created](http://forum.inductiveautomation.com/t/database-tables-not-created/17998):
>
> I am attempting to configure tag history and database connection after doing a fair amount of development and it seems as though the database tables are not getting created despite having a valid database connection and many tags configured to use the database for history. Using: Windows Server 2016, SQL Server 2017 Express, Ignition 7.9.7 Looking at the status for the database on the Ignition gateway everything appears to be in order (valid connection) but the total throughput only shows as 0…

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [May 24, 2018, 6:20pm UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/5 "2018-05-24T18:20:09Z")

</div>

Hey, sorry for the late response. For that project, we tried a few different things, but were unable to find a way to predict when the tables would recreate. We eventually wrote a script that deleted all the contents of the tag history tables with dates prior to the install date at the new site, and that worked well for us.

---

<div class="post-metadata">

**Author:** ![zacslade](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zacslade/32/3587_2.png) [@zacslade](https://forum.inductiveautomation.com/u/zacslade)\
**Post date:** [May 24, 2018, 6:21pm UTC](https://forum.inductiveautomation.com/t/when-are-db-tables-automatically-created/15089/6 "2018-05-24T18:21:01Z")

</div>

Oh! Just read your other thread. Glad you got it figured out. Good link.
