Accidently deleted wrong tags

I deleted wrong tags by accident and looking for a way to back track. If I create a new tag will this delete all the history from the original tag? How should I go about recovering this without re-creating from scratch?

Shooting from the hip on this one, but I think “deleting” tags only sets a column in the database to indicate that a tag is deleted. If you were to go into the database and find the tag, you can unset that value.

If you are using the default internal tag provider, then deleting the tag removes it. In an external tag provider it gets marked as deleted but not removed.

Historical data won’t go away when you delete a tag, its entry will still be in the sqlth_te table.

As mentioned, you won’t lose the history for the tag. If you recreate the tag at the same path, it will get linked back up.

If you deleted a lot of tags or aren’t sure which, there’s something you might be able to do, if you act fast: Ignition keeps auto backups of the internal database, taken periodically while edits are being made. Go to “{InstallDir}/data/db/autobackup”. Look at the dates of the files. If one exists from a point before the delete, copy it and put it somewhere safe.

To get what you need, you’ll need to restore it. In short, the files in that tar.gz are the “settings.*” files found in “data/db”, so you could just stop Ignition, and replace the current files with those. However, if you’ve made other changes since then, I’d recommend the following:

  1. Stop Ignition
  2. Copy/rename the “data/db” folder to something else, like “currentdb”.
  3. Create a new “db” folder. Extract the autobackup there.
  4. Start Ignition. Open the designer, export the tags to CSV.
  5. Stop Ignition, restore back your current db, start up and import the tags.

Hope this helps,

1 Like