Move the Historian Database to Another Drive

How to move Historian.db to another drive or folder, for example a separate data disk, with Historian Database Path on the Parameters page, on a single server and on a redundant pair.

Updated 5 min read
On this page (7 sections)
  1. What Is Moved
  2. Before You Start
  3. Move the Historian Database on a Single Server
  4. Check the Result
  5. Move the Historian Database on a Redundant Pair
  6. Messages
  7. Notes

What Is Moved

The historian database Historian.db holds the historic data, the historic alarms, the historic events and the audit trail. By default it is stored in the Database folder of the installation folder.

Historian Database Path in the Historian section of the Parameters page points the system at a historian database in another location, for example on a separate data disk. The system uses the file at that path as soon as the setting is saved, without a restart, and keeps using it after every restart.

FileLocation after the move
Historian.dbThe path entered in Historian Database Path.
Configuration.db and the other files in the Database folderUnchanged: the Database folder of the installation folder.
StandbyHistorian.db, on a redundant pairUnchanged: the Database\Redundancy folder of the installation folder.

Historian Database Path must point to an existing file. The page refuses a path where no file exists, so copy the database to the new location first and change the setting afterwards.

Before You Start

Prepare the following before moving the historian.

  • Plan a maintenance window. While the EnvisionSCADA site is stopped, no values are collected and no history is logged. The copy takes longer as the file grows. Current Size in the Historian section of the Parameters page shows the size of the file.
  • Check that the target drive has free space for the historian database and its future growth.
  • Log in with a user of the Administrators group. Only that group has access to the Parameters page.

Move the Historian Database on a Single Server

The example moves the historian to the folder D:\EnvisionHistorian.

  • Create the folder D:\EnvisionHistorian.

EnvisionSCADA runs under IIS in the EnvisionSCADA application pool, which writes the historian with the account IIS AppPool\EnvisionSCADA. Grant that account Modify permission on the folder, with the command below or on the Security tab of the folder properties. In the Select Users or Groups dialog, set the location to the local computer and enter IIS AppPool\EnvisionSCADA. The permission is needed on the folder and not only on the file, because the database writes a temporary journal file next to Historian.db while it saves changes.

Alternatively, grant the IIS_IUSRS group, which includes the account of every application pool on the server. When the Identity of the EnvisionSCADA application pool is set to another account in IIS Manager, grant that account instead.

Grant the EnvisionSCADA application pool Modify access using icacls
icacls "D:\EnvisionHistorian" /grant "IIS AppPool\EnvisionSCADA:(OI)(CI)M" /T
Alternative: grant IIS_IUSRS Modify access using icacls
icacls "D:\EnvisionHistorian" /grant "IIS_IUSRS:(OI)(CI)M" /T
  • In IIS Manager, select the EnvisionSCADA site and click Stop.
  • Copy Historian.db from the Database folder of the installation folder to D:\EnvisionHistorian. When a file named Historian.db-journal is present next to it, copy that file as well.
  • In IIS Manager, select the EnvisionSCADA site and click Start.
  • Log in, open the Parameters page and expand the Historian section.
  • Enter the full path of the file in Historian Database Path, for example D:\EnvisionHistorian\Historian.db, and click outside the field. The setting is saved when the field loses focus.
  • The page shows the message Historian database will now be used.

Change the setting directly after the start. Records logged between the start and the change are written to the file in the Database folder and are absent from the copy.

Check the Result

Verify the move before removing the original file.

  • Current Size in the Historian section of the Parameters page shows the size of the file at the new location.
  • The Historian Viewer shows records from before the move as well as records logged after it.
  • Keep the original Historian.db in the Database folder until these checks are complete. Remove it afterwards to free the disk space.

Move the Historian Database on a Redundant Pair

Historian Database Path is part of the configuration and is synchronized to the Standby node. Each node opens the file at that path on its own server, so the file must exist at the same path on both nodes.

The node on which the setting is saved switches to the new file immediately. The other node switches at its next start, or when it takes over as Primary.

Stop the Standby node before the Primary node. Stopping the Primary node first makes the Standby node take over as Primary, and the copies made afterwards no longer match the history that node logs.
  • On both nodes, create the folder at the same path and grant IIS AppPool\EnvisionSCADA Modify permission on it.
  • Stop the EnvisionSCADA site on the Standby node, then on the Primary node.
  • On both nodes, copy Historian.db from the Database folder of the installation folder to the new folder.
  • Start the EnvisionSCADA site on the node that was Primary. Log in on that node and set Historian Database Path as described for a single server.
  • Start the EnvisionSCADA site on the other node. It starts as Standby and receives the new setting through synchronization.
  • When the Standby node is Synced, restart its EnvisionSCADA site in IIS Manager, so it opens the file at the new location.

When the Standby node starts with a copy that is behind the Primary node, Backfill retrieves the missing records from the Primary node, as described in the Redundancy article.

Messages

The Parameters page reports the result of a change of Historian Database Path at the top of the page. A historian that cannot be opened at startup is reported on the login page.

MessageCauseAction
Historian database will now be used.The file was found and the system switched to it.None.
Database could not be found at this path.No file exists at the path, or the path names a folder.Enter the full path including the file name, for example D:\EnvisionHistorian\Historian.db.
'HistorianPath': Value must not contain commas.The path contains a comma.Use a folder and file name without commas.
A message that ends with The current historian database stays in use.The file could not be read or converted, for example because it is not a historian database, it is damaged, or the drive has too little free space for the conversion.Correct the cause and save the path again. Logging continues in the current historian meanwhile.
Database Error: Cannot read Historian Database at, followed by the pathAt startup the file at the configured path could not be opened, for example because the drive is unavailable or the folder permission is missing.Make the drive available, grant IIS AppPool\EnvisionSCADA Modify permission on the folder and restart the EnvisionSCADA site.

Notes

Clearing Historian Database Path switches the system back to Historian.db in the Database folder of the installation folder. Records logged at the other location stay in the file at that location.

When the file at the new path comes from an earlier version, it is converted when the setting is saved, before the system switches to it. The page waits until the conversion has completed, and logging continues in the current historian meanwhile. The Database Migration After an Upgrade article lists the duration and the free disk space the conversion needs.

Something missing or wrong in this article? Contact us