Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...

Restore tag and meta data

6min

Use Cases

Users can restore tag and meta data for example on a new server or after a factory reset.

This does require the corresponding tag definition. If the tag definition was purged as well or it is a new server, the tag definition needs to be restored prior.

On how to restore a data model please follow the instructions here:

User can do this either by using applications such as:

  • Microsoft SQL Server Management Studio
  • MSSQL CLI

This can also be used for building custom solutions based on applications which allow for an ODBC connection such as:

  • Excel
  • C#
  • .Net
  • Python

Method

Execute Stored Procedure PROREC_Misc_TagData_and_MetaData_Read_Backup

Input Variables

Variable name

Datatype

Description

Example

@Backupfile

NVARCHAR(100)

The complete path and filename of the tag and meta data backup file







Mandatory!

Can not be NULL or Empty

Windows Example:

D:\MSSQL\DATA\LE_PROREC_Tag_Meta_Backup_Nov-2-2022-3-24AM_Mar-23-2023-4-42PM_2023-03-23_17-42-56.bak



Linux Example:

/var/opt/mssql/data/LE_PROREC_Tag_Meta_Backup_Nov-2-2022-3-24AM_Mar-23-2023-4-42PM_2023-03-23_17-42-56.bak

How to use

To restore a backup of tag and meta data for a tag definition, call the stored procedure PROREC_Misc_TagData_and_MetaData_Read_Backup using the T-SQL EXEC or EXECUTE keyword and provide the Input variables. Below is an example using T-SQL in SQL Server Management Studio:

EXECUTE [LE_ProductionRecord].[dbo].[PROREC_Misc_TagData_and_MetaData_Read_Backup] @Backupfile = N'D:\MSSQL\DATA\LE_PROREC_Tag_Meta_Backup_Nov-2-2022-3-24AM_Mar-23-2023-4-42PM_2023-03-23_17-42-56.bak';

If an output window does exist, the progress can be observed.

restore tag and meta data
restore tag and meta data


Result

The stored procedure will verify that the provided values are correct and then restore the tag definition.

The result can be read back from the log table PROREC_Misc_Log.

Below is an example using T-SQL in SQL Server Management Studio:

SELECT TOP (100) [LogID] ,[LogType] ,[LogProcedure] ,[LogEntry] ,[LogTime] FROM [LE_ProductionRecord].[dbo].[PROREC_Misc_Log] WHERE [LogProcedure] = 'PROREC_Misc_TagData_and_MetaData_Read_Backup' Order by LogID Desc;

With the result returned

log entry tag and meta data restore
log entry tag and meta data restore