Asset Management Suite

 View Only

Using the ImportExportUtil to automate the Migration of Products, Components and Licenses 

Mar 17, 2017 09:02 AM

Hi,

The article below provides an automated way of performing an off box import / export (migration) of Software Products, Software Components, Software Purchases and Software Licenses using the Import / Export Utility.

  • You will need access to the Symantec_CMDB database via SSMS (Sql Server Management Studio) or another IDE.
  • Copy the script called GetLicenseInformationSQL.sql into your SSMS. This will generate the import / export util commands lines for your products + licenses etc.

You will need to makie some changes to the code depending on your environment.

The lines that start with "E:\Program files..." will most likely need to change to the drive path that your NS is installed on and where the ImportExportUtil.exe tool can be found.

SELECT 
	rsc.Name
	,rsc.Guid
	,'"E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q ' +cast(rsc.Guid as varchar(50)) + ' c:\temp\Components\' [ComponentExport]
	,RM_ResourceSoftware_Product.Name [Product Name]
	,RM_ResourceSoftware_Product.[Guid] AS [SoftwareProductGuid]
	,'"E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q ' +cast(RM_ResourceSoftware_Product.[Guid] as varchar(50)) + ' c:\temp\Products\' [ProductExport]
	,vi.Name [License Name]
	,l.Guid [License Guid]
	,'"E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q ' +cast(l.Guid as varchar(50)) + ' c:\temp\Licenses\' [LicenseExport]
	,vip.Name [Purchase Order Name]
	,sp.Guid [Purchase Order Guid]
	,'"E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q ' +cast(sp.Guid as varchar(50)) + ' c:\temp\PO\' [POExport]
	,spd.Quantity [LicenseCount]
	,spd.[Purchase Date]
	,sld.[Maintenance Renewal Cost]
	,sld.[Support Renewal Cost]
	,sld.[License Type]

Further along those same lines you can also change the Directories where teh components will be exported to. These folders will need to exist in order for this to work later.

When you run this, because of the component piece you will have duplicate product + license rules, but these can be handled. If you don't want the components rules to be exported, then comment out the line. Running the script will retrun something like this. 

  • The key field are:
  • Component Export
  • Product Export
  • License Export
  • PO Export

These each contain the commands required to export the various components.

Name Guid Component Export Product Name SoftwareProductGuid
7-Zip 9.20 (x64 edition) English x64 2C4CDC1F-361D-45AD-A6B2-A804B3ACE437 "E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q 2C4CDC1F-361D-45AD-A6B2-A804B3ACE437 c:\temp\Components\ 7-ZIP 49901DCB-1756-4FC5-8178-F1690AC9D5C7
VMware Workstation 10.0.5 04CF23FA-B07D-450E-A064-154872FEF3B9 "E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q 04CF23FA-B07D-450E-A064-154872FEF3B9 c:\temp\Components\ VMware Workstation 10 FB6C9B41-9320-4075-9E02-1D0CFBB48650
Microsoft Visio Professional 2013 - en-us 3AF139AF-7F44-4E2D-89D6-AB6A16F5547F "E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q 3AF139AF-7F44-4E2D-89D6-AB6A16F5547F c:\temp\Components\ Microsoft Visio Professional 2013 4737A9B5-F623-4DBC-948E-5E0B6F4A6916
Microsoft Visio Professional 2013 - en-us 7240D871-2E2A-4E2E-9D55-AB967253053F "E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q 7240D871-2E2A-4E2E-9D55-AB967253053F c:\temp\Components\ Microsoft Visio Professional 2013 4737A9B5-F623-4DBC-948E-5E0B6F4A6916
Microsoft Visio Professional 2013 - en-us 3AF139AF-7F44-4E2D-89D6-AB6A16F5547F "E:\Program Files\Altiris\Notification Server\Bin\Tools\importexportutil.exe" /export /q 3AF139AF-7F44-4E2D-89D6-AB6A16F5547F c:\temp\Components\ Microsoft Visio Professional 2013 4737A9B5-F623-4DBC-948E-5E0B6F4A6916

Repeat the below process for each of the 4 columns named above.

  1. Copy each of the Export columns into an Excel workbook. An example is shown below.

2017_03_17_12_28_38_Book1_Excel.png

  1. Select the column and choose the Data tab.
  2. Select the Remove Duplicates option, this will remove all duplicates from the rows.
  3. Copy the results into a bat file, i.e. Export Licenses.bat and copy them to the SMP.
  4. Run the bat file. This will export the above items into the designated folder.

Repeat the below process for each of the 4 pillars, please note there is a specific order in which to Import the items

  1. Copy the Calculate Import - [Item].txt (attached) into the respective folder. i.e. Calculate Import - Product.txt into the folder with the Export product Items. Change the extension to .bat.
  2. Run the bat files. This will create a new bat file that will contain import scripts for each item in the current folder.
  3. Open the [Item].bat file, i.e. Product.bat and look for an entry like "Calculate Import - Product.bat" - remove this entry from each file.

Run the Import scripts in the following order:

  1. Component.bat
  2. Product.bat
  3. PO.bat
  4. License.bat

Your products are now imported and associated!

Any questions, let me know.

Kind regards,

Kevin

Statistics
0 Favorited
4 Views
2 Files
0 Shares
4 Downloads
Attachment(s)
txt file
Calculate Import - Products.txt   211 B   1 version
Uploaded - Feb 25, 2020
txt file
GetLicenseInformationSQL.txt   2 KB   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.