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.
Goals and Symptoms
Background: The ION Enterprise 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. If it is necessary to rename a device, it is best to shut down the ION Log Inserter first.
This article describes the steps required to properly rename an existing device that is providing historical data. It assumes that the goal is to rename the device such that existing historical data will be assigned to this new meter name.
CAUTION: This procedure requires manual changes to the databases. Backup the ION_Data and ION_Network databases before proceeding.
Keywords: device, meter, rename, change name
Facts and Changes
The simplest way to rename a device such that pre-existing historical data is assigned to the new device name is to:
- Shut down the ION Log Inserter service,
- Rename the device in the Management Console, then
- Execute a series SQL queries to propagate this name change to specific database tables.
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)
Causes and Fixes
It is very important that you enter the SQL commands described in this article correctly. Please read all of the instructions carefully before proceeding. Make sure that you backup the databasesbefore beginning this procedure.
When instructed to execute SQL queries, you can use either the SQL Server Management Console (preferred) or the ION Database Manager SQL Editor.
Scenario 1 - The ION Log Inserter service is shut down before the device is renamed.
- Shut down the ION Log Inserter and ION Query Server services.
- 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'
- Start the Management Console and change the device name (in ION Enterprise 6.0, 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 =
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.
- Restart the ION Log Inserter and Query Server services
- Use Vista to verify that the historical data from the before the device renaming is continuous with the historical data from after the renaming.
- You may have to do some Vista diagram edits to reflect the name change
- If you are using ION Enterprise as a data collection system for ION EEM, see RESL197993 on what needs to be done in ION EEM after renaming a device in ION Enterprise.
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:
- Shut down the ION Log Inserter service.
- For this example, assume the the original device name was My.OldDevice and the new name is My.NewDevice
All ION Enterprise versions:
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')
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:
- 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.
- Restart the ION Log Inserter service.
- Check the continuity of your data using Vista.
- Use Web Reporter to verify that only the new source name appears in the source list.
It is important to note that even after a successful device rename that the tree file for the device is still present within the config/trees folder. This device will still appear within the Diagnostics viewer with a comment "Device does not exist in the system". The ION Services will need to be stopped and the tree file deleted or moved in order to remove it from the Diagnostics Viewer.
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.
Date Created: November 13, 2007
Last Revised: July 30, 2010 by JM
Original Author: MN
All content © 1992-2010 Schneider Electric
Legacy KB System (APS) Data: RESL189159 V8.0, Originally authored by KBAdPM on 11/14/2007, Last Edited by ChMu on 11/15/2013
Related ranges: ION Enterprise V6.0, ION Enterprise V5.6, ION Enterprise V5.5, ION Enterprise V5.0