diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/Assessments/CMS.png b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/Assessments/CMS.png
deleted file mode 100644
index 1f015ffb99..0000000000
Binary files a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/Assessments/CMS.png and /dev/null differ
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/glossary.md b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/glossary.md
index 79244411ce..1050049630 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/glossary.md
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/glossary.md
@@ -13,6 +13,8 @@ A list of terms and their definitions can be found below
* **Azure Region** - Azure data centers are separated by geography into regions in order to ensure low-latency and security
* **Azure Resource Group** - a logical container of Azure resources for management of Azure resources within it
* **Azure SQL Database** - an Azure based version of SQL database offered as a PaaS
+* **Azure SQL Managed Instance** - a PaaS Azure offer for SQL Server that is ran on Azure infrastructure. Microsoft will manage the complexities of the infrastructure for the user
+* **Azure SQL Virtual Machine (VM)** - a IaaS Azure offer for SQL Server that is ran on Azure infrastructure. Microsoft will manage the complexities of the infrastructure for the user
* **Azure Storage Account** - provides a unique namespace in Azure which forms the basis for addressing objects in Azure Storage
* **Azure Storage SKU** - a *stock keeping unit* or SKU is a product unit designation that distinguishes between the product and other products based on its attributes such as manufacturer, description, and product type. (see Appendices for a list of Storage SKU types)
* **Azure Subscription** - associates a user with Azure resources created by that user
@@ -25,13 +27,13 @@ A list of terms and their definitions can be found below
* **Juptyer Project** - a non-profit, OSS project that supports interactive data science computing across all programming languages
* **Markdown** - lightweight markup language with text formatting widely used in web documents
* **Microsoft PowerShell** - a task automation and configuration management framework. ADS Notebooks feature a PowerShell kernel in order to interface with the PS environment. PS is often used by systems engineers and admins.
+* **Offline Migration** - moving data between environments in a manner that is disruptive to the operation of the database, usually when a system is able to tolerate the downtime required as a trade-off for simplicity
* **OSS** - *open source software* is a decentralized software development model that encourages open collaboration and sharing.
* **PaaS** - *Platform-as-a-Service* is a cloud service that allows the use of an application without the complexity of building and maintaining the hardware infrastructure required by the application
-* **Point-to-Site VPN** - a VPN solution that allows a secure connection from an individual client computer to a remote network on the VPN.
+* **Point-to-Site (P2S) VPN** - a VPN solution that allows a secure connection from an individual client computer to a remote network on the VPN.
* **Python** - an interpreted high level OSS programming language often used by data scientists
-* **Site-to-Site VPN** - a VPN connection created between two sites, usually over the public Internet or a WAN connection. Normally requires a network adminstrator to setup and configure.
+* **Site-to-Site (S2S) VPN** - a VPN connection created between two sites, usually over the public Internet or a WAN connection. Normally requires a network adminstrator to setup and configure.
* **SQL Assessment API** - evaluates a SQL instance configuration for best practices
* **SQL Virtual Machine** - an IaaS Azure offer that provisions and manages virtual machine with SQL Server installed
-* **SQL Managed Instance** - a PaaS Azure offer for SQL Server that is ran on Azure infrastructure. Microsoft will manage the complexities of the infrastructure for the user
* **SMO** - SQL Management Objects are "objects designed for programmatic management of Microsoft SQL Server" ([Microsoft](https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/overview-smo))
* **VPN** - a *virtual private network* is a collection of computing resources that organizes and extends a private network configuration over the public Internet, normally using some kind of encryption for security and privacy.
\ No newline at end of file
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-SQLDB.ipynb b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-SQLDB.ipynb
index b92e49608d..a65ea8f63d 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-SQLDB.ipynb
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-SQLDB.ipynb
@@ -2,7 +2,8 @@
"metadata": {
"kernelspec": {
"name": "powershell",
- "display_name": "PowerShell"
+ "display_name": "PowerShell",
+ "language": "powershell"
},
"language_info": {
"name": "powershell",
@@ -17,33 +18,65 @@
{
"cell_type": "markdown",
"source": [
- "Migrate SQL Server Instance to Azure SQL Server VM\n",
- "================================"
+ "# Migrate SQL Server Database to Azure SQL DB\n",
+ "\n",
+ "## Overview\n",
+ "\n",
+ "Use this notebook when attempting to migrate a SQL Server database to Azure SQL Database. The process is different than using an Azure SQL Virtual Machine or Azure SQL Managed Instance. Refer to this [Microsoft docs](https://docs.microsoft.com/en-us/azure/dms/howto-sql-server-to-azure-sql-powershell) article for the method described.\n",
+ "\n",
+ "## Variables\n",
+ "\n",
+ "Use the table below as reference when configuring this notebook for execution.\n",
+ "\n",
+ "| Line | Variable | Description | Example |\n",
+ "| --- | --- | --- | --- |\n",
+ "| 1 | Subscription | Azure subscription name or ID | guid |\n",
+ "| 2 | dmsName | Name of the Data Migration Service | MyDms |\n",
+ "| 3 | dmsResourceGroup | Exact name of resource group to target or create | _MyAz\\_RG_ |\n",
+ "| 4 | loc | Specifies the location of the service | EastUS2 |\n",
+ "| 5 | vNetName | Specify the name of the vnet Azure resource to use | vnet1 |\n",
+ "| 6 | Subnet | Name of the Azure subnet resource to use | subnet1 |\n",
+ "| 7-8 | dmsSku | This parameter corresponds to DMS Sku name. The currently supported sku is listed. | GeneralPurpose\\_4vCores |\n",
+ "| 9 | TargetSqlServer | Target SQL server to migrate to | \"sqllazuretarget.database.windows.net\" |\n",
+ "| 10 | SourceDb | Name of database to migrate from, the _source_ | AdventureWorks2016 |\n",
+ "| 11 | TargetDb | Name of database to migrate to, in case it differs from the source, the _target_ | AdventureWorks2016 |\n",
+ "\n",
+ "Lastly, specify the table names explicitly as a PowerShell list of names:\n",
+ "\n",
+ "> `$Tables = @(`\"HumanResources.Department\", \"HumanResources.Employee\", \"HumanResources.EmployeeDepartmentHistory\")"
],
"metadata": {
"azdata_cell_guid": "f706da59-22c3-4317-bf41-c00dde794097"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "### Load Required Modules\r\n",
- ""
- ],
- "metadata": {
- "azdata_cell_guid": "67e288c6-63df-475e-9cad-bab323d30c4e"
- }
- },
{
"cell_type": "code",
"source": [
- "Import-Module dbatools\r\n",
- "Import-Module Az.Resources\r\n",
- "Import-Module Az.Storage"
+ "$Subscription = \"\"\r\n",
+ "$dmsName = \"\"\r\n",
+ "$dmsResourceGroup = \"\"\r\n",
+ "$loc = \"\"\r\n",
+ "$vNetName = \"\"\r\n",
+ "$Subnet = Subnet1\r\n",
+ "#$dmsSku = Basic_2vCores # unclear which is correct, listing both for now\r\n",
+ "$dmsSku = GeneralPurpose_4vCores \r\n",
+ "$TargetSqlServer = \"\"\r\n",
+ "$SourceDb = \"\"\r\n",
+ "$TargetDb = \"\"\r\n",
+ "\r\n",
+ "# Define a list of tables to migrate\r\n",
+ "$Tables = @()\r\n",
+ "<# :::For example::: \r\n",
+ "$Tables = @(\"HumanResources.Department\", `\r\n",
+ " \"HumanResources.Employee\", `\r\n",
+ " \"HumanResources.EmployeeDepartmentHistory\", `\r\n",
+ " \"HumanResources.EmployeePayHistory\", `\r\n",
+ " \"HumanResources.JobCandidate\", `\r\n",
+ " \"HumanResources.Shift\")\r\n",
+ "#>"
],
"metadata": {
- "azdata_cell_guid": "26df73fa-6f4f-40b4-8c47-10ce7e2db404",
- "tags": []
+ "azdata_cell_guid": "2624afc0-2403-4d42-ad88-6adcfe1a5c2b"
},
"outputs": [],
"execution_count": null
@@ -51,180 +84,34 @@
{
"cell_type": "markdown",
"source": [
- "### Choose Migration Source\r\n",
- "\r\n",
- "Required parameters:\r\n",
- "\r\n",
- "- Server Name\r\n",
- "- Database Name\r\n",
- "- "
+ "## Connections"
],
"metadata": {
- "azdata_cell_guid": "1e70b806-c94d-4be2-87cf-ad73fb85821d"
+ "azdata_cell_guid": "f0a5e313-a2a6-4e75-ab94-5d96436b8473"
}
},
{
"cell_type": "code",
"source": [
- "$Credential = Get-Credential -Message \"Type the name and password of the local administrator account.\"\r\n",
- "$Credential"
- ],
- "metadata": {
- "azdata_cell_guid": "41faae8f-6245-4acb-88d5-dbb0b92ad7f5"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Variables\r\n",
+ "# Configure virtual network\r\n",
+ "$vNet = Get-AzVirtualNetwork -ResourceGroupName $dmsResourceGroup -Name $vNetName\r\n",
"\r\n",
- "## Global\r\n",
- "$Location = \"West US 2\"\r\n",
- "$ResourceGroupName = \"sqlmig\"\r\n",
+ "$vSubNet = Get-AzVirtualNetworkSubnetConfig -VirtualNetwork $vNet -Name $Subnet\r\n",
"\r\n",
- "## Storage\r\n",
- "$StorageName = $ResourceGroupName + \"storage\"\r\n",
- "$StorageSku = \"Premium_LRS\"\r\n",
+ "# Create a Database Connection Info object for the source connections\r\n",
+ "$sourceConnInfo = New-AzDmsConnInfo -ServerType SQL `\r\n",
+ " -DataSource $SourceSqlServer `\r\n",
+ " -AuthType SqlAuthentication `\r\n",
+ " -TrustServerCertificate:$true\r\n",
"\r\n",
- "## Network\r\n",
- "$InterfaceName = $ResourceGroupName + \"ServerInterface\"\r\n",
- "$NsgName = $ResourceGroupName + \"nsg\"\r\n",
- "$VNetName = $ResourceGroupName + \"VNet\"\r\n",
- "$SubnetName = \"Default\"\r\n",
- "$VNetAddressPrefix = \"10.0.0.0/16\"\r\n",
- "$VNetSubnetAddressPrefix = \"10.0.0.0/24\"\r\n",
- "$TCPIPAllocationMethod = \"Dynamic\"\r\n",
- "$DomainName = $ResourceGroupName\r\n",
- "\r\n",
- "##Compute\r\n",
- "$VMName = $ResourceGroupName + \"VM\"\r\n",
- "$ComputerName = $ResourceGroupName + \"Server\"\r\n",
- "$VMSize = \"Standard_DS13_v2\"\r\n",
- "$OSDiskName = $VMName + \"OSDisk\"\r\n",
- "\r\n",
- "##Image\r\n",
- "$PublisherName = \"MicrosoftSQLServer\"\r\n",
- "$OfferName = \"SQL2017-WS2016\"\r\n",
- "$Sku = \"SQLDEV\"\r\n",
- "$Version = \"latest\"\r\n",
- ""
+ "# target connection\r\n",
+ "$targetConnInfo = New-AzDmsConnInfo -ServerType SQL `\r\n",
+ " -DataSource $TargetSqlServer `\r\n",
+ " -AuthType SqlAuthentication `\r\n",
+ " -TrustServerCertificate:$false"
],
"metadata": {
- "azdata_cell_guid": "7e251e62-b47c-4800-986d-b71be8bc0a21"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Resource Group\r\n",
- "New-AzResourceGroup -Name $ResourceGroupName -Location $Location\r\n",
- "$ResourceGroupName\r\n",
- "$Location"
- ],
- "metadata": {
- "azdata_cell_guid": "eea4904c-55f0-47a4-81a3-5daf0a864687"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Storage\r\n",
- "$StorageAccount = New-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName -SkuName $StorageSku -Kind \"Storage\" -Location $Location\r\n",
- ""
- ],
- "metadata": {
- "azdata_cell_guid": "b19f1450-0283-4772-862a-3e59b65d0e75"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "$StorageAccount = Get-AzStorageAccount -ResourceGroupName $ResourceGroupName -Name $StorageName"
- ],
- "metadata": {
- "azdata_cell_guid": "42602cef-76ed-4c91-a2f0-a7a8a6132eff"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Network\r\n",
- "$SubnetConfig = New-AzVirtualNetworkSubnetConfig -Name $SubnetName -AddressPrefix $VNetSubnetAddressPrefix\r\n",
- "$VNet = New-AzVirtualNetwork -Name $VNetName -ResourceGroupName $ResourceGroupName -Location $Location -AddressPrefix $VNetAddressPrefix -Subnet $SubnetConfig\r\n",
- "$PublicIp = New-AzPublicIpAddress -Name $InterfaceName -ResourceGroupName $ResourceGroupName -Location $Location -AllocationMethod $TCPIPAllocationMethod -DomainNameLabel $DomainName\r\n",
- "#$NsgRuleRDP = New-AzNetworkSecurityRuleConfig -Name \"RDPRule\" -Protocol Tcp -Direction Inbound -Priority 1000 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 3389 -Access Allow\r\n",
- "$NsgRuleSQL = New-AzNetworkSecurityRuleConfig -Name \"MSSQLRule\" -Protocol Tcp -Direction Inbound -Priority 1001 -SourceAddressPrefix * -SourcePortRange * -DestinationAddressPrefix * -DestinationPortRange 1433 -Access Allow\r\n",
- "#$Nsg = New-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroupName -Location $Location -Name $NsgName -SecurityRules $NsgRuleRDP,$NsgRuleSQL\r\n",
- "$Nsg = New-AzNetworkSecurityGroup -ResourceGroupName $ResourceGroupName -Location $Location -Name $NsgName -SecurityRules $NsgRuleSQL\r\n",
- "$Interface = New-AzNetworkInterface -Name $InterfaceName -ResourceGroupName $ResourceGroupName -Location $Location -SubnetId $VNet.Subnets[0].Id -PublicIpAddressId $PublicIp.Id -NetworkSecurityGroupId $Nsg.Id\r\n",
- ""
- ],
- "metadata": {
- "azdata_cell_guid": "0435fd83-3e9c-4929-930a-2b7022db3f99"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "$StorageAccount"
- ],
- "metadata": {
- "azdata_cell_guid": "37e1869b-eb9f-465a-87d3-78120e4c6d06"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Compute\r\n",
- "$VirtualMachine = New-AzVMConfig -VMName $VMName -VMSize $VMSize\r\n",
- "#$Credential = Get-Credential -Message \"Type the name and password of the local administrator account.\"\r\n",
- "$VirtualMachine = Set-AzVMOperatingSystem -VM $VirtualMachine -Windows -ComputerName $ComputerName -Credential $Credential -ProvisionVMAgent -EnableAutoUpdate #-TimeZone = $TimeZone\r\n",
- "$VirtualMachine = Add-AzVMNetworkInterface -VM $VirtualMachine -Id $Interface.Id\r\n",
- "#$OSDiskUri = $StorageAccount.PrimaryEndpoints.Blob.ToString() + \"vhds/\" + $OSDiskName + \".vhd\"\r\n",
- "#$VirtualMachine = Set-AzVMOSDisk -VM $VirtualMachine -Name $OSDiskName -VhdUri $OSDiskUri -Caching ReadOnly -CreateOption FromImage\r\n",
- "$VirtualMachine = Set-AzVMSourceImage -VM $VirtualMachine -PublisherName $PublisherName -Offer $OfferName -Skus $Sku -Version $Version"
- ],
- "metadata": {
- "azdata_cell_guid": "d0a4da84-d591-436e-8b6c-d4cb2787a6e2"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Create the VM in Azure\r\n",
- "New-AzVM -ResourceGroupName $ResourceGroupName -Location $Location -VM $VirtualMachine\r\n",
- ""
- ],
- "metadata": {
- "azdata_cell_guid": "70967b75-1ef7-4d69-aad9-0184cfb44aa9"
- },
- "outputs": [],
- "execution_count": null
- },
- {
- "cell_type": "code",
- "source": [
- "# Add the SQL IaaS Extension, and choose the license type\r\n",
- "New-AzSqlVM -ResourceGroupName $ResourceGroupName -Name $VMName -Location $Location -LicenseType \"PAYG\""
- ],
- "metadata": {
- "azdata_cell_guid": "a8db01b1-a009-4367-bd39-77187482afc3"
+ "azdata_cell_guid": "dbf40b4b-af83-46c6-9db1-15f45eb24382"
},
"outputs": [],
"execution_count": null
@@ -232,24 +119,33 @@
{
"cell_type": "markdown",
"source": [
- "### Verify No Active Connections"
+ "## Select Data by Defining Database and Table Mapping"
],
"metadata": {
- "azdata_cell_guid": "81259d7e-62ac-4cdd-9e1b-2cb4ddb3d3b2"
+ "azdata_cell_guid": "b9113be6-0aef-41fd-afe8-e1ce51c5999b"
}
},
{
"cell_type": "code",
"source": [
+ "# Create a list of databases to migrate\r\n",
+ "$dbInfo1 = New-AzDataMigrationDatabaseInfo -SourceDatabaseName $SourceDb\r\n",
+ "$dbList = @($dbInfo1)\r\n",
"\r\n",
- "$ServerName = \"sqltools2017-3\"\r\n",
- "$DatabaseName = \"Keep_WideWorldImporters\"\r\n",
+ "# Create a table map \r\n",
+ "$tableMap = New-Object 'system.collections.generic.dictionary[string,string]'\r\n",
+ "foreach ($table in $Tables)\r\n",
+ "{\r\n",
+ " $tableMap.Add($table,$table)\r\n",
+ "}\r\n",
"\r\n",
- "Get-DbaProcess -SqlInstance $ServerName -Database $DatabaseName | \r\n",
- "Select Host, login, Program"
+ "# Select the data\r\n",
+ "$selectedDbs = New-AzDmsSelectedDB -MigrateSqlServerSqlDb -Name $SourceDb `\r\n",
+ " -TargetDatabaseName $TargetDb `\r\n",
+ " -TableMap $tableMap"
],
"metadata": {
- "azdata_cell_guid": "28393e59-4ea1-4f0f-8f9f-8a504f15e723"
+ "azdata_cell_guid": "3b6551e9-4d42-441e-8fe1-f247471995df"
},
"outputs": [],
"execution_count": null
@@ -257,19 +153,34 @@
{
"cell_type": "markdown",
"source": [
- "### Create Target SQL Server VM"
+ "## Create Service Project"
],
"metadata": {
- "azdata_cell_guid": "07d076d0-abf3-496c-8ecb-f85102c4104b"
+ "azdata_cell_guid": "a9abeeb9-4f45-4e0c-8b1b-20270dddece4"
}
},
{
"cell_type": "code",
"source": [
- ""
+ "$service = New-AzDms -ResourceGroupName $dmsResourceGroup `\r\n",
+ " -ServiceName $dmsName `\r\n",
+ " -Location $loc `\r\n",
+ " -Sku $dmsSku `\r\n",
+ " -VirtualSubnetId $vSubNet.Id\r\n",
+ "\r\n",
+ "# Create a project object\r\n",
+ "$project = New-AzDataMigrationProject -ResourceGroupName $dmsResourceGroup `\r\n",
+ " -ServiceName $service.Name `\r\n",
+ " -ProjectName $dmsNameProject `\r\n",
+ " -Location $loc `\r\n",
+ " -SourceType SQL `\r\n",
+ " -TargetType SQLDB `\r\n",
+ " -SourceConnection $sourceConnInfo `\r\n",
+ " -TargetConnection $targetConnInfo `\r\n",
+ " -DatabaseInfo $dbList"
],
"metadata": {
- "azdata_cell_guid": "6f190c2d-7361-4db8-819d-29087eae8aaa"
+ "azdata_cell_guid": "77415bea-b098-4a9f-a166-9751e4261fc1"
},
"outputs": [],
"execution_count": null
@@ -277,60 +188,104 @@
{
"cell_type": "markdown",
"source": [
- "### Create temporary resources for data movement"
+ "## Credentials for Source and Target"
],
"metadata": {
- "azdata_cell_guid": "cc18027e-4636-465d-abaf-f3de88fea406"
+ "azdata_cell_guid": "f8c27b61-d2c9-43ee-bc93-8182752edb33"
}
},
{
"cell_type": "code",
"source": [
- "$location = \"westus\"\r\n",
- "$resourceGroup = \"temp-sqlmigration\"\r\n",
- "$blobStorageAccount = \"temp-sqlmigration\"\r\n",
- "$containerName = \"backups\"\r\n",
- "\r\n",
- "\r\n",
- "\r\n",
- "New-AzResourceGroup"
+ "$secpasswd = ConvertTo-SecureString -String $sourcePassword -AsPlainText -Force\r\n",
+ "$sourceCred = New-Object System.Management.Automation.PSCredential ($sourceUserName, $secpasswd)\r\n",
+ "$secpasswd = ConvertTo-SecureString -String $targetPassword -AsPlainText -Force\r\n",
+ "$targetCred = New-Object System.Management.Automation.PSCredential ($targetUserName, $secpasswd)"
],
"metadata": {
- "azdata_cell_guid": "f7d53cb1-a55d-4634-95f7-d3e8cf9fab52"
+ "azdata_cell_guid": "61aa72d1-7492-41e8-847b-89a76ca28e0f"
},
"outputs": [],
"execution_count": null
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- "$targetLogin = Get-Credential -Message \"Login to target SQL Server instance as:\""
+ "## Create the Migration Task\r\n",
+ "Uncomment lines to perform validation checks during the task."
],
"metadata": {
- "azdata_cell_guid": "c3dbd1a7-5514-4fdc-9430-736c92e875a4"
+ "azdata_cell_guid": "681feaa0-f7d8-4322-af0c-75ab6402fd6e"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "$migTask = New-AzDataMigrationTask -TaskType MigrateSqlServerSqlDb `\r\n",
+ " -ResourceGroupName $dmsResourceGroup `\r\n",
+ " -ServiceName $service.Name `\r\n",
+ " -ProjectName $project.Name `\r\n",
+ " -TaskName $dmsNameTask `\r\n",
+ " -SourceConnection $sourceConnInfo `\r\n",
+ " -SourceCred $sourceCred `\r\n",
+ " -TargetConnection $targetConnInfo `\r\n",
+ " -TargetCred $targetCred `\r\n",
+ " -SelectedDatabase $selectedDbs `\r\n",
+ "# -SchemaValidation `\r\n",
+ "# -DataIntegrityValidation `\r\n",
+ "# -QueryAnalysisValidation `"
+ ],
+ "metadata": {
+ "azdata_cell_guid": "4dc629cc-1978-4bf8-80fc-69de093ac435"
},
"outputs": [],
"execution_count": null
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- "$myGwIp = Get-AzPublicIpAddress -Name $GwIP1 -ResourceGroup $RG1\r\n",
- "$myGwIp.IpAddress"
+ "## Monitor the Migration Task"
],
"metadata": {
- "azdata_cell_guid": "bc6e8330-95bb-44a5-a117-020f657cad2b"
+ "azdata_cell_guid": "9074e9e5-f5f7-4d30-a4ec-b6d3f112a600"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "# Monitor the migration\r\n",
+ "if (($migTask.ProjectTask.Properties.State -eq \"Running\") -or ($migTask.ProjectTask.Properties.State -eq \"Queued\"))\r\n",
+ "{\r\n",
+ " write-host \"migration task running\"\r\n",
+ "}\r\n",
+ "else \r\n",
+ "{\r\n",
+ " Write-Host \"migration task is $migTask.ProjectTask.Properties.State\"\r\n",
+ "}"
+ ],
+ "metadata": {
+ "azdata_cell_guid": "89af76b7-1801-4d26-b6cd-907a9b455839"
},
"outputs": [],
"execution_count": null
},
{
- "cell_type": "code",
+ "cell_type": "markdown",
"source": [
- ""
+ "## Deleting the DMS Instance\r\n",
+ "This should remove the DMS instance from the Resource Group. Uncomment to perform the task. "
],
"metadata": {
- "azdata_cell_guid": "a61ffe69-0929-4246-8ad0-846f540f4e0c"
+ "azdata_cell_guid": "ed3bf1e7-a92f-4985-b89c-85f45b8e6821"
+ }
+ },
+ {
+ "cell_type": "code",
+ "source": [
+ "#Remove-AzDms -ResourceGroupName $dmsResourceGroup -ServiceName $dmsName"
+ ],
+ "metadata": {
+ "azdata_cell_guid": "245b4d4e-7559-4534-bff8-3af390ac1e3a"
},
"outputs": [],
"execution_count": null
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-VM.ipynb b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-VM.ipynb
index e9a62190ae..71f999a7e4 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-VM.ipynb
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/db-to-VM.ipynb
@@ -2,7 +2,8 @@
"metadata": {
"kernelspec": {
"name": "powershell",
- "display_name": "PowerShell"
+ "display_name": "PowerShell",
+ "language": "powershell"
},
"language_info": {
"name": "powershell",
@@ -17,8 +18,7 @@
{
"cell_type": "markdown",
"source": [
- "Migrate SQL Server Database to Azure SQL Server VM\n",
- "================================"
+ "# Migrate SQL Server Database to Azure SQL VM"
],
"metadata": {
"azdata_cell_guid": "f706da59-22c3-4317-bf41-c00dde794097"
@@ -267,4 +267,4 @@
"execution_count": null
}
]
-}
+}
\ No newline at end of file
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/instance-to-VM.ipynb b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/instance-to-VM.ipynb
index f786320307..d29bebdd9c 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/instance-to-VM.ipynb
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/instance-to-VM.ipynb
@@ -2,7 +2,8 @@
"metadata": {
"kernelspec": {
"name": "powershell",
- "display_name": "PowerShell"
+ "display_name": "PowerShell",
+ "language": "powershell"
},
"language_info": {
"name": "powershell",
@@ -17,8 +18,7 @@
{
"cell_type": "markdown",
"source": [
- "Migrate SQL Server Instance to Azure SQL Server VM\n",
- "================================"
+ "# Migrate SQL Server Instance to Azure SQL VM"
],
"metadata": {
"azdata_cell_guid": "f706da59-22c3-4317-bf41-c00dde794097"
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/readme.md b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/readme.md
index de8f83d568..44ddbbdf4e 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/readme.md
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/offline-migration/readme.md
@@ -1,12 +1,25 @@
# Offline Migration
[Home](../readme.md)
-This chapter contains a set of notebooks useful for doing offline migration of databases and SQL instances to Azure. For instance migration, these notebooks assume the Azure SQL Virtual Machine, Azure SQL Managed Instance, or Azure SQL DB Server have already been created.
+This chapter is useful for performing an **Offline Migration** of SQL Server 2005 and above to Azure using ADS Notebooks. Offline migrations are by definition disruptive to the flow of data such as in a web application. With these notebooks, a foundation for automated offline migration can be built.
+
+There are [many methods](https://datamigration.microsoft.com/) to consider when migrating to the cloud. The notebooks in this chapter cover the following scenarios:
## Notebooks in this Chapter
-- [Migrate Instance to Azure SQL VM](instance-to-VM.ipynb)
+- [Migrate SQL Server Instance to Azure SQL VM](instance-to-VM.ipynb) using [dbatools](https://dbatools.io), a powerful PS library for SQL tasks.
-- [Migrate Database to Azure SQL VM](db-to-VM.ipynb)
+- [Migrate SQL Server Database to Azure SQL VM](db-to-VM.ipynb) using dbatools
-- [Migrate Database to Azure SQL DB](db-to-SQLDB.ipynb)
+- [Migrate SQL Server Database to Azure SQL DB](db-to-SQLDB.ipynb) using PowerShell
+## Why Migrate Data Offline?
+There are many reasons to do an offline data migration. If the cost of losing connectivity for the duration of an offline migration can be minimized, then it often outperforms ensuring uptime when moving to the cloud from on-premise. Consider the time it takes to develop and test the deployment process, the infrastructure required to switch networking routing dynamically, and the cost of managing a migration team with the appropriate skills required for an online migration.
+
+## Recommendations for a Successful Migration
+Since the Data Migration Assistant and the Data Migration Service both complement a full migration, use the [Assessments](..\Assessments/readme.md) notebooks and fix all recommendations prior to migration to avoid potential problems during and after migration.
+- All pre-requisite libraries are outlined in the [pre-requisites notebook](../prereqs.ipynb)
+- Always keep backups of the data in standard formats available to be redeployed in case of a problem
+- Test the entire migration process including the process used to restore from backup
+- Automate the migration in such a way that anyone can perform it, given access
+- Consider creating a new notebook that contains simple data tests with known values on the new system after deployment
+##
\ No newline at end of file
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/prereqs.ipynb b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/prereqs.ipynb
index d8fa2f7b00..ffe2fb66df 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/prereqs.ipynb
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/prereqs.ipynb
@@ -2,7 +2,8 @@
"metadata": {
"kernelspec": {
"name": "powershell",
- "display_name": "PowerShell"
+ "display_name": "PowerShell",
+ "language": "powershell"
},
"language_info": {
"name": "powershell",
@@ -52,9 +53,9 @@
{
"cell_type": "markdown",
"source": [
- "## PowerShellGet and PowerShell Gallery Modules\n",
+ "## PowerShell Modules\n",
"\n",
- "If you do not have PS Nuget provider installed, then please see [Installing PowerShellGet](https://docs.microsoft.com/en-us/powershell/scripting/gallery/installing-psget). The initial setup for the PowerShellGet module may require elevated permissions and is recommended to be done in a separate PowerShell command prompt. \n",
+ "If you do not have PS Nuget provider installed, then please see [Installing PowerShellGet](https://docs.microsoft.com/en-us/powershell/scripting/gallery/installing-psget). If the following code block fails on the first line, setup PowerShellGet with an elevated PowerShell in a separate command window.\n",
"\n",
"The modules required by the toolkit are available on the [PowerShell Gallery](https://www.powershellgallery.com/), a central repository for sharing PS modules and scripts. The setup code in this notebook will create a temporary call to install required PowerShell modules in the current user scope. If the modules have not already been installed, the following code will install them with a new gallery registration setup as trusted to enable installation of modules without prompting. After installing the modules, the gallery registration will be removed.\n",
"\n",
@@ -125,14 +126,16 @@
"\n",
"SQL Assessment API is part of the SQL Server Management Objects (SMO) and can be used with the SQL Server PowerShell module. Because installing the modules may require a local Administrator account's permission, it cannot be done automatically with this Notebook. The **Assessments** Notebooks require the following:\n",
"\n",
- "- [Install SMO](https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/installing-smo?view=sql-server-ver15)\n",
- "- [Install SQL Server PowerShell module](https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module?view=sql-server-ver15)\n",
+ "- [Install SMO](https://docs.microsoft.com/en-us/sql/relational-databases/server-management-objects-smo/installing-smo?view=sql-server-ver15)\n",
+ "- [Install SQL Server PowerShell module](https://docs.microsoft.com/en-us/sql/powershell/download-sql-server-ps-module?view=sql-server-ver15)\n",
"\n",
"## Compatibility Assessment Tool - Data Migration Assistant\n",
"\n",
- "The Compatibility Assessment Notebook requires the Data Migration Assistant tool to be installed in order to execute. The installation link would be [Data Migration Assistant download](https://www.microsoft.com/en-us/download/confirmation.aspx?id=53595)\n",
+ "The Compatibility Assessment Notebook requires the [Data Migration Assistant](https://www.microsoft.com/en-us/download/confirmation.aspx?id=53595) tool to be installed in order to execute.\n",
"\n",
- "With version 2.1 and above, when installation of Data Migration Assistant is successful, it will install dmacmd.exe in _%ProgramFiles%\\\\Microsoft Data Migration Assistant_ folder."
+ "**Note:**\n",
+ "\n",
+ "> By Default, DMACMD.EXE will be installed to the \"%ProgramFiles%\\\\Microsoft Data Migration Assistant\" folder."
],
"metadata": {
"azdata_cell_guid": "1b49a7e5-a773-4104-8f88-bd2ea3c806a3"
diff --git a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/readme.md b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/readme.md
index e655d71b68..8d02c1f218 100644
--- a/extensions/azurehybridtoolkit/notebooks/hybridbook/content/readme.md
+++ b/extensions/azurehybridtoolkit/notebooks/hybridbook/content/readme.md
@@ -14,7 +14,7 @@
* [High Availability and Disaster Recovery](hadr/readme.md) - Notebooks to leverage Azure SQL for business continuity in a hybrid cloud environment.
-* [Offline Migration](offline-migration/readme.md) - Notebooks to perform various migrations.
+* [Offline Migration](offline-migration/readme.md) - Notebooks to manage SQL migration tasks to the cloud
* [Glossary](glossary.md) - set of defined terms.