Recreating a database from files

This section describes how recreate a database based on the database files of a Apis Honeystore. The database files are typically obtained from another computer running Apis Honeystore, and you must have all the files associated with the database available. Also, you must have Apis Honeystore installed on the computer.

Restoring files from backup or alternate source media

Make sure that you have all the necessary files present on your system. These include the configuration file and the historical data files, as described in section Backup.

Now, with the files present on your computer, we have two choices; either to recreate the database on the exact same location and with the same name, or to recreate the database to a different location and/or a different name.

A. Recreate database at exact same location and with same name

When you have recreated the database files exactly at the same locations and with the same names as they were on the source computer, all you have to do is to enter a registry entry for the database.

Using the regedit.exe application located in your Windows System folder, locate the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Prediktor\Apis\ApisHoneyStore\Databases

Beneath this key, assuming the database is named MYDB, create a new registry key named MYDB. Then, create a new string value named ConfigFile beneath this key. The value of the string value must be the full path and name to the configuration file of the database. E.g.,  C:\\Apis\Config\ApisHoneystore\MYDB.acdb.

As for the location of the historical data files, their location is kept stored inside the file configuration file, meaning that as long as you haven't changed the path of these, they will be found automatically. Restart the Apis Honeystore services, and the new database should be loaded by Apis Honeystore.

B. Recreate database to a different disk drive and/or with a different name

We might want to restore/recreate the database to a different disk drive, and/or we need or want to rename the database, i.e. a database already exists having the same name as the one we want to recreate. Then, we have to change the correct configuration parameters in the meta storage for the database before loading it into Honeystore.

B1. Using Prediktor Backup Restore utility (BARE API)

todo...

B2. Metastorage in configuration files

If the meta data of the database is stored in separate configuration files, we will have to open the configuration file offline and modify the desired values, ie. Name, CachePath and/or DataDirPath properties. We use a utility called ApisStructuredStorageViewer.exe for this. This application is part of the APIS Expert tools package and should be used with care. Always take a backup of the configuration file before opening and modifying it in this utility.

The name property is identified with the Attrib ID 10. The CachePath property is identified with AttribID 20. The DataDirPath property is identified with AttribID 20. Note, if the CachePath and the DataDirPath properties are equal, the DataDirPath is omitted from the config file.

B3. Metastorage in separate SQL database (HoneyStoreConfigDB)

If the meta data of the database is stored in a separate sql database, the HoneyStoreConfigDB, locate the database you want to recreate in the HSDatabase table. Change the desired values of the Name, PATH and DATADIRPATH columns, to reflect your new name and/or file locations. Note, the column PATH maps to the database property CachePath.

Restart the Apis Honeystore services, and the new database should be loaded by Apis Honeystore.