Troubleshooting the Migration
The Windows Server Migration Tools deployment log file is located at windir%\Logs\SmigDeploy.log. Additional Windows Server Migration Tools log files are created at the following locations:
%windir%\Logs\ServerMigration.log
In Windows Server 2008 and Windows Server 2008 R2: %localappdata%\SvrMig\Log
In Windows Server 2003: %userprofile%\Local Settings\Application Data\SvrMig\Log
Viewing the content of Windows Server Migration Tools result objects
All Windows Server Migration Tools cmdlets return results as objects. You can save result objects, and then query them for more information about the settings and data that were migrated. You can also use result objects as input for other Windows PowerShell commands and scripts.
Result object descriptions
The Windows Server Migration Tools Import-SmigServerSetting and Export-SmigServerSetting cmdlets return results in a list of MigrationResult objects. Each MigrationResult object contains information about the data or setting that the cmdlet processes, the result of the operation, and any related error or warning messages. The following table describes the properties of a MigrationResult object.
Property name |
Type |
Definition |
ItemType |
Enum |
The type of item being migrated. Values include General, WindowsFeatureInstallation, WindowsFeature, and OSSetting. |
ID |
String |
The ID of the migrated item. Examples of values include Local User, Local Group, and DHCP. |
Success |
Boolean |
The value True is displayed if migration was successful; otherwise, False is displayed. |
DetailsList |
List <MigrationResultDetails> |
A list of MigrationResultDetails objects. |
Send-SmigServerData and Receive-SmigServerData cmdlets return results in a list of MigrationDataResult objects. Each MigrationDataResult object contains information about the data or share that the cmdlet processes, the result of the operation, any error or warning messages, and other related information. The following table describes the properties of a MigrationDataResult object.
Property name |
Type |
Definition |
ItemType |
Enum |
The type of migrated item. Values include File, Folder, Share, and Encrypted File. |
SourceLocation |
String |
The source location of the item, shown as a path name. |
DestinationLocation |
Boolean |
The destination location of the item, shown as a path name. |
Success |
Boolean |
The value True is displayed if migration was successful; otherwise, False is displayed. |
Size |
Integer |
The item size, in bytes. |
ErrorDetails |
List <MigrationResultDetails> |
A list of MigrationResultDetails objects. |
Success |
Boolean |
The value True is displayed if migration was successful; otherwise, False is displayed. |
Error |
Enum |
Error enumeration for errors that occurred. |
WarningMessageList |
List <String> |
A list of warning messages. |
The following table describes the properties of objects within the MigrationResultDetails object that are common to the MigrationResult object and the MigrationDataResult object.
Property name |
Type |
Definition |
FeatureID |
String |
The name of the migration setting that is related to the item. Examples of values include IPConfig and DNS. This property is empty for data migration. |
Messages |
List <String> |
A list of detailed event messages. |
DetailCode |
Integer |
The error code or warning code associated with each event message. |
Severity |
Enum |
The severity of an event, if an event occurred. Examples of values include Information, Error, and Warning. |
Title |
String |
Title of the result object. Examples of values include the physical address of a network adapter for IP configuration, or the user name for local user migration. |
Examples of result objects
The following examples show how to store the list of the result objects in a variable, and then use the variable in a query to return the content of result objects after the migration is complete.
To store a list of result objects as a variable for queries
To run a cmdlet and save the result in variable, type a command in the following format, and then press ENTER.
$VariableName = $(Cmdlet)
The following is an example:
$ImportResult = $(Import-SmigServerSetting -FeatureId DHCP -User all -Group -Path D:\rmt\DemoStore -force -Verbose)
This command runs the Import-SmigServerSetting cmdlet with several parameters specified, and then saves the result objects in the variable ImportResult.
After the Import-SmigServerSetting cmdlet has completed its operations, you can return the information that is contained in the result object by typing a command in the following format, and then pressing ENTER.
$VariableName
In the following example, the variable is named ImportResult.
$ImportResult
This command returns the information that is contained in the result objects that were returned by Import-SmigServerSetting in the example shown in step 1.
The following is an example of the output that is displayed by calling the ImportResult variable:
ItemType ID Success DetailsList
-------- -- ------- -----------
OSSetting Local User True {Local User, Loc...
OSSetting Local Group True {Local Group, Lo...
WindowsFeature DHCP True {}
Each line of the preceding code sample is a migration result for an item that was migrated by using the Import-SmigServerSetting cmdlet. The column heading names are properties of MigrationResult objects. You can incorporate these properties into another command to return greater detail about result objects, as shown by the following examples.
To display a specific property for all the result objects in the list, type a command in the following format, and then press ENTER.
$<VariableName>| Select-Object -ExpandProperty <PropertyName>
The following is an example:
$importResult | Select-Object -ExpandProperty DetailsList
You can run more advanced queries to analyze result objects by using Windows PowerShell cmdlets. The following are examples:
The following command returns only the details of result objects that have the ID “Local User.”
$ImportResult | Where-Object { $_.ID -eq "Local User" } | Select-Object -ExpandProperty DetailsList
The following command returns only the details of result objects that have the ID “Local User” and have a message severity equal to “Warning.”
$ImportResult | Where-Object { $_.ID -eq "Local User" } | Select-Object -ExpandProperty DetailsList | ForEach-Object { if ($_.Severity -eq "Warning") {$_} }
The following command returns only the details of result objects that have the ID “Local User” and have the title “Remote Desktop Users.”
$ImportResult | Where-Object { $_.ID -eq "Local Group" } | Select-Object -ExpandProperty DetailsList | ForEach-Object { if ($_.Title -eq "Remote DesktopUsers") {$_} }
More information about querying results
For more information about the cmdlets that are used in the preceding examples, see the following additional resources in the Microsoft Technical Library:
Where-Object (https://go.microsoft.com/fwlink/?LinkId=134853)
Select-Object (https://go.microsoft.com/fwlink/?LinkId=134858)
ForEach-Object (https://go.microsoft.com/fwlink/?LinkId=134860)
For more information about Windows PowerShell scripting techniques, see What Can I Do With Windows PowerShell? (https://go.microsoft.com/fwlink/?LinkId=134862).
Understanding the messages from the iSCSI Target Migration tool
The iSCSI Target Server Migration tool (iSCSITargetSettings.PS1) does not produce a log file, but it prints diagnostics messages on the console. These messages show the outcome of the operations that are being attempted and performed.
For example, the following message shows information about saved settings:
PS C:\Program Files\Microsoft iSCSI Software Target> .\iSCSITargetSettings.PS1 -Export -FileName $env:temp\test00000000.xml
Number of Target(s) saved in the Export settings: 4.
Target Names:
test000
test001
test002
test1111
Number of Virtual Disk(s) saved in the Export settings: 3.
Virtual Disk DevicePaths:
s:\test000.vhd
t:\test000.vhd
z:\test000.vhd
Number of Virtual Disk(s) NOT saved in the Export settings: 0.
Virtual Disk DevicePaths:
The following message shows that not all the virtual disks are eligible for migration:
PS D:\Program Files\Microsoft iSCSI Software Target> .\iSCSITargetSettings.PS1 -Export -FileName $env:temp\test00000001.xml
Number of Target(s) saved in the Export settings: 4.
Target Names:
test000
test001
test002
test1111
Number of Virtual Disk(s) saved in the Export settings: 3.
Virtual Disk DevicePaths:
s:\test000.vhd
t:\test000.vhd
z:\test000.vhd
Number of Virtual Disk(s) NOT saved in the Export settings: 1.
Virtual Disk DevicePaths:
\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy{B6B3C77C-93CC-11DF-B3FE-001CC0C60A6E}\test000.vhd
The following message shows information about the settings restore phase:
PS C:\Program Files\Microsoft iSCSI Software Target> .\iSCSITargetSettings.PS1 -Import -file $env:temp\test00000000.xml
Importing settings from file 'E:\Users\administrator\AppData\Local\Temp\test00000001.xml'.
The operation may take a long time.
Number of Target(s) imported from the Import settings: 4.
Targets:
test000
test001
test002
test1111
Number of Virtual Disk(s) imported from the Import settings: 3.
Virtual Disk:
s:\test000.vhd
t:\test000.vhd
z:\test000.vhd