Technical FAQs

Ask a Question

How to change a device name and associate the old data with the new device name in ION Enterprise 5.0/5.5/5.6/6.0 and SPM 7.0.1.

Issue
Management Console allows a user to easily change the name of a device. Until version 6.0, the user was given no indication of the effect that this would have on historical data access for the renamed device. If a device is renamed while the ION Log Inserter service is running, the Log Inserter will create a new source in the ION_Data database, and all historical data collected after the device is renamed is assigned to this new source name. 

Product Line
ION Enterprise 5.x, 6.x
Struxureware Power Monitoring 7.0.1

Environment
Management Console

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.* ​

If the Log Inserter is left running when the device is renamed in the Management Console, a more complicated series of steps is required to ensure that pre-existing historical data is associated with the new device name. This article describes both scenarios, and addresses all versions of ION Enterprise (5.0, 5.5, 5.6 and 6.0) and Struxureware Power Monitoring.

It is very important that you enter the SQL commands described in this article correctly. Please read all of the instructions carefully before proceeding.

Scenario 1 - The ION Log Inserter service is shut down before the device is renamed.

  1. Backup the ION_Data and ION_Network databases
  2. Shut down the ION Log Inserter and ION Query Server services.
  3. Take note of the original device name as it appears in the Management Console. For the purposes of these instructions, let's call it 'My.OldDeviceName'
  4. Start the Management Console and change the device name (in ION Enterprise 6.0 and SPM 7.0.1, you will see a warning dialog. When asked if you want to proceed, choose Yes). For this example, let's rename it from My.OldDeviceName to My.NewDeviceName. Changing the device name in the Management Console will only change its name in the Device table in ION_Network. You will also need to change the name in the Source table in ION_Data, and in the IAS_Source table (ION Enterprise 5.5) or in the SRC_Source table (ION Enterprise 5.6 and greater)

ION_Data Database - All ION Enterprise versions - Update device name in the Source table:
Update the name in the Source table to reflect the name change by executing the following SQL query

UPDATE Source SET name='My.NewDeviceName' where ID= ( SELECT ID FROM Source WHERE Name =
'My.OldDeviceName')

ION_Network Database - ION Enterprise 5.6 and greater - Update the device name in SRC_Source
Update the name in the SRC_Source table in ION_Network by running the following SQL command against the ION_Network database:

UPDATE SRC_Source SET name='My.NewDeviceName' where SourceID = (SELECT SourceID FROM SRC_SOURCE WHERE Name = 'My.OldDeviceName')

ION_Network Database - ION Enterprise 5.5 only - Update the device name in IAS_Source
Update the name in the IAS_Source table in the ION_Network database by running the following SQL command against the ION_Network database:

UPDATE IAS_Source SET name='My.NewDeviceName' where SourceID = (SELECT SourceID FROM SRC_SOURCE WHERE Name = 'My.OldDeviceName')

ION Enterprise 5.0 only - no changes are necessary in the ION_Network database.

Final Steps:
  1. Restart the ION Log Inserter and Query Server services
  2. Use Vista to verify that the historical data from the before the device renaming is continuous with the historical data from after the renaming
  3. You may have to do some Vista diagram edits to reflect the name change

Scenario 2 - The device is renamed in the Management Console while the ION Log Inserter service is running

If a device is renamed in the Management Console while the Log Inserter is still running, a new source will be created in the Source table in the ION_Data database. Historical data uploaded from this device, once it has been renamed, will be assigned to this new source. It is necessary to run a series of SQL queries to connect the pre-existing data assigned to the old device name to the new data that will be assigned to the new source name. To proceed:
  1. Backup the ION_Data and ION_Network databases
  2. Shut down the ION Log Inserter service.
  3. For this example, assume the the original device name was My.OldDevice and the new name is My.NewDevice

All ION Enterprise versions:

ION_Data
1. Update the DataLogStamp/EventLog/WaveformLog tables to use the sourceID created for the new device name for the pre-existing historical data. Run the following SQL queries against the ION_Data database:

UPDATE DataLogStamp SET SourceID = (SELECT ID FROM Source WHERE Name = 'My.NewDevice') WHERE SourceID = (SELECT ID FROM Source WHERE Name = 'My.OldDevice')
//// NOTE: For SPM 7.0 up to but not including 7.2.2, change DataLogStamp to DataLog2 - for SPM 7.2.2 and newer, this operation is unnecessary ////

UPDATE EventLog SET SourceID = (SELECT ID FROM Source WHERE Name = 'My.NewDevice') WHERE SourceID = (SELECT ID FROM Source WHERE Name = 'My.OldDevice')

UPDATE WaveformLog SET SourceID = (SELECT ID FROM Source WHERE Name = 'My.NewDevice') WHERE SourceID = (SELECT ID FROM Source WHERE Name = 'My.OldDevice')

2. Delete the obsolete source, i.e. My.OldDevice from the ION_Data database now that all of the historical data has been associated with the new device name - see RESL191111

ION Enterprise 5.6 and greater:

ION_Network
  1. Delete the obsolete source, i.e. My.OldDevice from the ION_Network database. The Log Inserter will have corrected all the required entries for the new source name - see RESL191111 - be sure to follow the steps corresponding to your version of ION Enterprise.

Final Steps:
  1. Restart the ION Log Inserter service.
  2. Check the continuity of your data using Vista.
  3. Use Web Reporter to verify that only the new source name appears in the source list.
  4. Refresh the associated tree file. See FA207727.

BCPM Specific:
A single BCPM device defined in the Management Console will have as many as 42 channels mapped as unique sources in the databases, thus the procedure for change the name of a BCPM device requires remapping many sources. The attached sql script file should make this process less painful, The script will need to be edited to reflect your specific devices names, both old and new.

BCPM_name_Change.sql

Note: This procedure changed in Power Monitoring Expert 7.2.2. See FA271636 for how to rename a device in Power Monitoring Expert.
Was this helpful?
What can we do to improve the information ?