How to export and import device information from one database to another in LES DC

Version 3

    Details

    Lumension Endpoint Security Device Control (LDC) 4.4 and higher

     

     

    INFORMATION

    The following procedure works for Ivanti Device Control (versions 4.4 and later) and allows export of all Devices with their Unique ID.

    NOTE:  This method does NOT export device groups. Devices within groups will be exported, however they will need to be grouped after import manually.

    Ensure you have a full backup of the source and target databases.

    PROCEDURE

    Export pre-requisite:

    When running DIMPEX export phase on old SX database for the first time, please run below code in SQL Management Studio to populate required fields:

     

    USE sx

    UPDATE devices SET code='USBPrinter' WHERE devid=16

    UPDATE devices SET code='Blackberry' WHERE devid=18

    UPDATE devices SET code='Wireless' WHERE devid=21

    UPDATE devices SET code='PS2' WHERE devid=24

    UPDATE devices SET code='Biometric' WHERE devid=25

    UPDATE devices SET code='WPD' WHERE devid=26

     

    Exporting the device information:

    • Open SQL Server Management Studio query analyser on SQL box where the OLD SX database is installed
    • Go to menu TOOLS > OPTIONS and Select QUERY RESULTS > SQL SERVER > GENERAL
    • The DEFAULT DESTINATION FOR RESULTS should be set to RESULTS TO FILE
    • Go to QUERY RESULTS > SQL SERVER > RESULTS TO TEXT and uncheck the first box (include column header)
    • Close & reopen SQL Query Analyser

    NOTE: If you use the default query method where the results are shown in the lower RESULTS pane of SQL Management Studio, you can also simply select all lines, copy them to the clipboard (CTRL-C) and paste them in a TXT file (through notepad or any plain text editor)

    NOTE: When exporting records, please ensure line length in SQL Studio is set to maximum, so to ensure lines do not get truncated

    NOTE: export will not work when using SQL Server 2005, as the CONVERT function is not available. Please replace it with master.dbo.fn_varbintohexstr or contact support for SQL Server 2005 DIMPEX script version or use SQL query provided in this article.

    • Load the query DIMPEX7.SQL
    • Execute this query and it will prompt for a file name....
    • Select SAVE AS TYPE "All files (*.*)" and call the filename SDCEVENT.LOG.
    • Open this file, remove the last line showing the number of rows returned, and save the file as UNICODE (UCS2 LE BOM)

    Importing the device information:

    • Put this SDCEVENT.LOG file in the %SYSTEMROOT%\SXDATA\SHADOW of ANY machine running the LES client which communicates with the new SXS server (which connects to the NEW DB)

    NOTE:  This action requires local admin rights and that client hardening is switched off

    • An existing SDCEVENT.LOG file can be overwritten, although it is recommended to fetch the log from that machine through the console (SMC)
    • Also, this only needs to be performed once, there is no need to redo this procedure on another endpoint
    • Open SMC > Log Explorer
    • Click the FETCH LOG button and select as the Computer the machine where you just put the custom SDCEVENT.LOG
    • Fetch the log (this may take a few minutes depending on the performance of your SQL Server while processing the log) and then right-click and select all devices listed in the log you wish to transfer to the new DB
    • Once the log is fetched, please use Log Explorer module on the new system to display DEVICE-ATTACHED events. Right-click each (or multiple selection) and select Add Device.

    Duplicate devices (which were in old and are in the new DB already) will not be selectable during the import process in SMC.

    All (selected) devices from the old DB are now in the new DB (along with already existing devices) and ready for use.