Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mani0070
Created October 8, 2018 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mani0070/52efbe64cc8c50a3b626408e0d13b45f to your computer and use it in GitHub Desktop.
Save mani0070/52efbe64cc8c50a3b626408e0d13b45f to your computer and use it in GitHub Desktop.
$sourceaccountname="https://name.documents.azure.com:443/"
$sourceaccountkey="<source account key>"
$sourcedatabase="<source database name>"
$targetaccountname="https://name.documents.azure.com:443/"
$targetaccountkey="<target account name>"
$targetdatabase="<target database name>"
$collectionstomigrate = @("collection1","collection2","collection3")
foreach ($collectionname in $collectionstomigrate)
{
Write-Host "Porcessing the collection $($collectionname)"
& c:\tools\dt-1.7\dt.exe /s:DocumentDB /s.ConnectionString:"AccountEndpoint=$sourceaccountname;AccountKey=$sourceaccountkey;Database=$sourcedatabase;" /s.Collection:$collectionname /t:DocumentDBBulk /t.ConnectionString:" AccountEndpoint=$targetaccountname;AccountKey=$targetaccountkey;Database=$targetdatabase;" /t.Collection:$collectionname /t.CollectionThroughput:1000 /t.UpdateExisting:true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment