Skip to content

Commit 45587e7

Browse files
authored
Merge pull request MicrosoftDocs#1485 from wenhua-helen/master
Update Add-SPMTTask.md
2 parents 00f0de6 + 7c88bd2 commit 45587e7

File tree

1 file changed

+85
-5
lines changed

1 file changed

+85
-5
lines changed

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

Lines changed: 85 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ Json sample for SharePoint migration(whole site):
9191
"TargetPath":"https://YourTargetSite/targetSubSite2"
9292
}
9393
```
94-
95-
## 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 JSON defined task.
98-
9994
## EXAMPLES
10095

10196
### Example 1
@@ -131,6 +126,91 @@ Add-SPMTTask -FileShareSource $Global:FileshareSource -TargetSiteUrl $Global:SPO
131126
```
132127
Add one File Share migration task and one SharePoint 2013 migration task to the registered migration session.
133128

129+
### DESCRIPTION
130+
Add a new migration task to the registered migration session.
131+
Currently there are three different types of tasks allowed: File Share task, SharePoint task and JSON defined task.
132+
133+
### Example 2
134+
Code snippets for bulk migration by loading the sample CSV with the name of spmt.csv:
135+
136+
### Load CSV
137+
$csvItems = import-csv "C:\spmt.csv" -Header c1,c2,c3,c4,c5,c6
138+
ForEach ($item in $csvItems)
139+
{
140+
Write-Host $item.c1
141+
Add-SPMTTask -FileShareSource $item.c1 -TargetSiteUrl $item.c4 -TargetList $item.c5 -TargetListRelativePath $item.c6
142+
}
143+
144+
Two migration tasks are defined in the file of spmt.csv.
145+
146+
D:\MigrationTest\Files\Average_1M\c,,,https://SPOSite.sharepoint.com,Documents,Test
147+
C:\work\Powershell\negative,,,https://SPOSite.sharepoint.com/,Documents,DocLibrary_SubfolderName
148+
149+
Code snippets for bulk migration by loading one JSON file:
150+
151+
### Load JSON
152+
$jsonItems = Get-Content -Raw -Path "C:\spmt.json" | ConvertFrom-Json
153+
ForEach ($taskItem in $jsonItems.Tasks)
154+
{
155+
$jsonString = ConvertTo-Json $taskItem -Depth 100
156+
Add-SPMTTask -JsonDefinition $jsonString -SharePointSourceCredential $onpremCredential
157+
}
158+
159+
Three migration tasks are defined in the file of spmt.json.
160+
161+
```
162+
{
163+
"Tasks":[
164+
{
165+
"SourcePath":"http://On-prem/sites/test",
166+
"TargetPath":"https://YourSPO.sharepoint.com",
167+
"Items":{
168+
"Lists":[
169+
{
170+
"SourceList":"list-01",
171+
"TargetList":"list-01"
172+
}
173+
],
174+
"SubSites":[
175+
176+
]
177+
}
178+
},
179+
{
180+
"SourcePath":"http://On-prem/sites/test",
181+
"TargetPath":"https://YourSPO.sharepoint.com",
182+
"Items":{
183+
"Lists":[
184+
{
185+
"SourceList":"list-02",
186+
"TargetList":"list-02"
187+
}
188+
],
189+
"SubSites":[
190+
191+
]
192+
}
193+
},
194+
{
195+
"SourcePath":"http://On-prem/sites/test",
196+
"TargetPath":"https://YourSPO.sharepoint.com",
197+
"Items":{
198+
"Lists":[
199+
{
200+
"SourceList":"doclib-01",
201+
"TargetList":"doclib-01"
202+
}
203+
],
204+
"SubSites":[
205+
206+
]
207+
}
208+
}
209+
]
210+
}
211+
212+
```
213+
134214
## PARAMETERS
135215

136216
### -FileShareSource

0 commit comments

Comments
 (0)