Skip to content

Commit 8df8044

Browse files
authored
Merge pull request MicrosoftDocs#1316 from wenhua-helen/master
update migration PowerShell cmdlets
2 parents 1673e3f + 7f149ed commit 8df8044

9 files changed

+377
-143
lines changed

spmt/spmt-ps/spmt/Add-SPMTTask.md

Lines changed: 103 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,129 @@ schema: 2.0.0
1010
# Add-SPMTTask
1111

1212
## SYNOPSIS
13-
{{Fill in the Synopsis}}
14-
13+
Add a new migration task to the registered migration session. Currently there are three different types of tasks allowed: File share task, SharePoint task and a JSON defined task.
1514
## SYNTAX
1615

17-
### FileShare (Default)
16+
### FileShare
1817
```
1918
Add-SPMTTask -FileShareSource <String> -TargetSiteUrl <String> -TargetList <String>
2019
[-TargetListRelativePath <String>]
2120
```
22-
2321
### SharePointMigrateAll
24-
```
25-
Add-SPMTTask [-MigrateAll] -SharePointSourceSiteUrl <String> -SharePointSourceCredential <PSCredential>
26-
-TargetSiteUrl <String>
22+
```
23+
Add-SPMTTask -SharePointSourceCredential <PSCredential> -SharePointSourceSiteUrl <string> -TargetSiteUrl <string> -MigrateAll
2724
```
2825

2926
### SharePointMigrateSelected
3027
```
31-
Add-SPMTTask -SharePointSourceSiteUrl <String> -SharePointSourceCredential <PSCredential>
32-
[-SourceListRelativePath <String>] -SourceList <String> -TargetSiteUrl <String> -TargetList <String>
33-
[-TargetListRelativePath <String>]
28+
Add-SPMTTask -SharePointSourceSiteUrl <string> -SharePointSourceCredential <pscredential> -SourceList <string> [-SourceListRelativePath <string>] -TargetSiteUrl <string> -TargetList <string> [-TargetListRelativePath <string>]
3429
```
3530

3631
### Json
3732
```
38-
Add-SPMTTask [-SharePointSourceCredential <PSCredential>] -JsonDefinition <String>
33+
Add-SPMTTask [-JsonDefinition <string>]
34+
Add-SPMTTask -SharePointSourceCredential <PSCredential> [-JsonDefinition <string>]
35+
Json defined migration task sample 1:
36+
Customer scenario:migrate data from File Share or local disk to SPO.
37+
{
38+
"SourcePath":"\\LocalOrFileShareDataSource",
39+
"TargetPath":"https://YourTargetSite",
40+
"TargetList":"Documents",
41+
"TargetListRelativePath":"subfolder"
42+
}
43+
Json defined migration task sample 2:
44+
Customer scenario:migrate on-prem site to SPO site.
45+
{
46+
"SourcePath":"http://YourOnPremSite",
47+
"TargetPath":"https://YourTargetSite",
48+
"Items":{
49+
"Lists":[
50+
{
51+
"SourceList":"sourceListName",
52+
"TargetList":"targetListName"
53+
}
54+
]
55+
}
56+
}
57+
Json defined migration task sample 3:
58+
Customer scenario:migrate on-prem sites with subsites to SPO.
59+
{
60+
"SourcePath":"http://YourOnPremSite",
61+
"TargetPath":"https://YourTargetSite",
62+
"Items":{
63+
"Lists":[
64+
{
65+
"SourceList":"listVersion2",
66+
"TargetList":"ListVersion2"
67+
},
68+
{
69+
"SourceList":"listVersion3",
70+
"TargetList":"ListVersion3"
71+
}
72+
],
73+
"SubSites":[
74+
{
75+
"SourceSubSitePath":"subSite",
76+
"TargetSubSitePath":"targetSubSite",
77+
"Lists":[
78+
{
79+
"SourceList":"testSubListB",
80+
"TargetList":"targetSubList"
81+
}
82+
]
83+
}
84+
]
85+
}
86+
}
87+
Json defined migration task sample 4:
88+
Customer scenario:migrate on-prem subsite to SPO subsite.
89+
{
90+
"SourcePath":"http://YourOnPremSite/subsite2",
91+
"TargetPath":"https://YourTargetSite/targetSubSite2"
92+
}
3993
```
4094

4195
## DESCRIPTION
42-
{{Fill in the Description}}
96+
Add a new migration task to the registered migration session.
97+
Currently there are three different types of tasks allowed: File share task, SharePoint task and a JSON defined task.
4398

4499
## EXAMPLES
45100

46101
### Example 1
47102
```
48-
PS C:\> {{ Add example code here }}
103+
#Define On-prem SharePoint 2013 data source#
104+
105+
$Global:SourceSiteUrl = "http://YourOnPremSite/"
106+
$Global:OnPremUserName = "Yourcomputer\administrator"
107+
$Global:OnPremPassword = ConvertTo-SecureString -String "OnPremPassword" -AsPlainText -Force
108+
$Global:SPCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:OnPremUserName, $Global:OnPremPassword
109+
$Global:SourceListName = "SourceListName"
110+
111+
112+
#Define SPO target#
113+
$Global:SPOUrl = “https://contoso.sharepoint.com”
114+
$Global:UserName = “[email protected]
115+
$Global:PassWord = ConvertTo-SecureString -String "YourSPOPassword" -AsPlainText -Force
116+
$Global:SPOCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:UserName, $Global:PassWord
117+
$Global:TargetListName = "TargetListName"
118+
119+
#Define Fileshare data source#
120+
$Global:FileshareSource = "YourFileShareDataSource"
121+
#Import SPMT Migration Module#
122+
Import-Module Microsoft.SharePoint.MigrationTool.PowerShell
123+
#Register the SPMT session with SPO credentials#
124+
Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force
125+
#Add two tasks into the session. One on-prem and one file share task.#
126+
Add-SPMTTask -SharePointSourceCredential $Global:SPCredential -SharePointSourceSiteUrl $Global:SourceSiteUrl -TargetSiteUrl $Global:SPOUrl -MigrateAll
127+
Add-SPMTTask -FileShareSource $Global:FileshareSource -TargetSiteUrl $Global:SPOUrl -TargetList "Documents"
49128
```
50129

51-
{{ Add example description here }}
130+
Add one file share migration task and one on-prem 2013 migration task to registered migration session.
52131

53132
## PARAMETERS
54133

55134
### -FileShareSource
56-
{{Fill FileShareSource Description}}
135+
This parameter is mandatory for file share migration. Please specify the source folder path. For example: C:\SourceFiles.
57136

58137
```yaml
59138
Type: String
@@ -68,7 +147,7 @@ Accept wildcard characters: False
68147
```
69148
70149
### -JsonDefinition
71-
{{Fill JsonDefinition Description}}
150+
Define one File share task or SharePoint task in JSON format.
72151
73152
```yaml
74153
Type: String
@@ -83,7 +162,7 @@ Accept wildcard characters: False
83162
```
84163
85164
### -MigrateAll
86-
{{Fill MigrateAll Description}}
165+
This is a switch parameter. If set to True, all lists will be migrated. If set to False, the customer will migrate selected lists.
87166
88167
```yaml
89168
Type: SwitchParameter
@@ -98,7 +177,7 @@ Accept wildcard characters: False
98177
```
99178
100179
### -SharePointSourceCredential
101-
{{Fill SharePointSourceCredential Description}}
180+
This is a switch parameter. If set to True, all lists will be migrated. If set to False, the customer will migrate selected lists.
102181
103182
```yaml
104183
Type: PSCredential
@@ -125,7 +204,7 @@ Accept wildcard characters: False
125204
```
126205
127206
### -SharePointSourceSiteUrl
128-
{{Fill SharePointSourceSiteUrl Description}}
207+
Use this parameter to define SharePoint data source site URL.
129208
130209
```yaml
131210
Type: String
@@ -140,7 +219,7 @@ Accept wildcard characters: False
140219
```
141220
142221
### -SourceList
143-
{{Fill SourceList Description}}
222+
This parameter is mandatory and defines source document library name or list name.
144223
145224
```yaml
146225
Type: String
@@ -155,7 +234,7 @@ Accept wildcard characters: False
155234
```
156235
157236
### -SourceListRelativePath
158-
{{Fill SourceListRelativePath Description}}
237+
This parameter is optional and is to define one or more migration data source relative paths.
159238
160239
```yaml
161240
Type: String
@@ -170,7 +249,7 @@ Accept wildcard characters: False
170249
```
171250
172251
### -TargetList
173-
{{Fill TargetList Description}}
252+
This parameter is mandatory and defines target library name or list name.
174253
175254
```yaml
176255
Type: String
@@ -185,7 +264,7 @@ Accept wildcard characters: False
185264
```
186265
187266
### -TargetListRelativePath
188-
{{Fill TargetListRelativePath Description}}
267+
This parameter is optional. You can define one or more target relative paths in a list and make the value to this parameter.
189268
190269
```yaml
191270
Type: String
@@ -200,7 +279,7 @@ Accept wildcard characters: False
200279
```
201280
202281
### -TargetSiteUrl
203-
{{Fill TargetSiteUrl Description}}
282+
This parameter is mandatory for both file share and on-prem migration and defines the target site URL.
204283
205284
```yaml
206285
Type: String

spmt/spmt-ps/spmt/Get-SPMTMigration.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,54 @@ schema: 2.0.0
1010
# Get-SPMTMigration
1111

1212
## SYNOPSIS
13-
{{Fill in the Synopsis}}
13+
Return object of current session. It includes current tasks status and current session level settings.
14+
The status of current tasks includes
15+
1. Count of scanned files
16+
2. Count of migrated files
17+
3. Migration error message if there is any.
1418

1519
## SYNTAX
1620

1721
```
18-
Get-SPMTMigration
22+
1923
```
2024

2125
## DESCRIPTION
22-
{{Fill in the Description}}
23-
26+
Return object of current session. It includes current tasks status and current session level settings.
2427
## EXAMPLES
2528

2629
### Example 1
2730
```
28-
PS C:\> {{ Add example code here }}
31+
#Define On-prem SharePoint 2013 data source#
32+
33+
$Global:SourceSiteUrl = "http://YourOnPremSite/"
34+
$Global:OnPremUserName = "Yourcomputer\administrator"
35+
$Global:OnPremPassword = ConvertTo-SecureString -String "OnPremPassword" -AsPlainText -Force
36+
$Global:SPCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:OnPremUserName, $Global:OnPremPassword
37+
$Global:SourceListName = "SourceListName"
38+
39+
40+
#Define SPO target#
41+
$Global:SPOUrl = “https://contoso.sharepoint.com”
42+
$Global:UserName = “[email protected]
43+
$Global:PassWord = ConvertTo-SecureString -String "YourSPOPassword" -AsPlainText -Force
44+
$Global:SPOCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Global:UserName, $Global:PassWord
45+
$Global:TargetListName = "TargetListName"
46+
47+
#Define Fileshare data source#
48+
$Global:FileshareSource = "YourFileShareDataSource"
49+
#Import SPMT Migration Module#
50+
Import-Module Microsoft.SharePoint.MigrationTool.PowerShell
51+
#Register the SPMT session with SPO credentials#
52+
Register-SPMTMigration -SPOCredential $Global:SPOCredential -Force
53+
#Add two tasks into the session. One on-prem and one file share task.#
54+
Add-SPMTTask -SharePointSourceCredential $Global:SPCredential -SharePointSourceSiteUrl $Global:SourceSiteUrl -TargetSiteUrl $Global:SPOUrl -MigrateAll
55+
Add-SPMTTask -FileShareSource $Global:FileshareSource -TargetSiteUrl $Global:SPOUrl -TargetList "Documents"
56+
#Start Migration#
57+
Start-SPMTMigration
58+
PS C:\Users\YourUserName> Get-SPMTMigration
2959
```
30-
31-
{{ Add example description here }}
60+
Start a migration first, and then run "Get-SPMTMigration" to get current tasks status and session level settings
3261

3362
## PARAMETERS
3463

0 commit comments

Comments
 (0)