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

Restore a data model configuration

6min

Use Cases

Users can restore a data model for example on a new server or after a factory reset.

After a data model has been restored, it is also possible to paly back corresponding production records.

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_Hierarchy_Read_Backup

Input Variables

Variable name

Datatype

Description

Example

@Backupfile

NVARCHAR(100)

The complete path and filename of the hierarchy backup file







Mandatory!

Can not be NULL or Empty

Windows Example:

D:\MSSQL\DATA\LE_PROREC_Misc_Hierarchy_Backup_Urethanes_2023-03-23_14-07-47.bak.



Linux Example:

/var/opt/mssql/data/LE_PROREC_Misc_Hierarchy_Backup_Urethanes_2023-03-23_14-07-47.bak.

How to use

To restore a backup of a specific data model configuration, call the stored procedure PROREC_Misc_Hierarchy_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_Hierarchy_Read_Backup] @Backupfile = N'/var/opt/mssql/data/LE_PROREC_Misc_Hierarchy_Backup_Urethanes_2023-03-23_14-07-47.bak';

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

restore of data model configuration
restore of data model configuration


Result

The stored procedure will verify that the provided values are correct and then restore the dat model configuration.

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_Hierarchy_Read_Backup' Order by LogID Desc;

With the result returned

data model configuration restored
data model configuration restored