{ "metadata": { "kernelspec": { "name": "powershell", "display_name": "PowerShell" }, "language_info": { "name": "powershell", "codemirror_mode": "shell", "mimetype": "text/x-sh", "file_extension": ".ps1" } }, "nbformat_minor": 2, "nbformat": 4, "cells": [ { "cell_type": "markdown", "source": [ "# Migration Compatibility Assessment\n", "Use dmacmd.exe to assess databases in an unattended mode, and output the result to JSON or CSV file. This method is especially useful when assessing several databases or huge databases.\n", "\n", "## Notebook Variables\n", "\n", "| Line | Variable | Description |\n", "| --- | --- | --- |\n", "| 1 | ExecutableFile | Path to DmaCmd.exe file, usually _\"C:\\\\Program Files\\\\Microsoft Data Migration Assistant\\\\DmaCmd.exe\"_ if installed to default location |\n", "| 2 | AssessmentName | Unique name for assessment |\n", "| 3 | Server | Target SQL Server |\n", "| 4 | InitialCatalog | Name of the database for the specified server |\n", "| 5 | ResultPath | Path and name of the file to store results in json format |" ], "metadata": { "azdata_cell_guid": "6764dd37-fb1f-400d-8f2b-70bc36fc3b61" } }, { "cell_type": "code", "source": [ "$ExecutableFile = \"C:\\Program Files\\Microsoft Data Migration Assistant\\DmaCmd.exe\" # Update if different\r\n", "$AssessmentName = \"\"\r\n", "$Server = \"\"\r\n", "$InitialCatalog = \"\"\r\n", "$ResultPath = \"\"" ], "metadata": { "azdata_cell_guid": "d81972c1-3b0b-47d9-b8a3-bc5ab4001a34" }, "outputs": [], "execution_count": null }, { "cell_type": "markdown", "source": [ "### **Single-database assessment using Windows authentication and running compatibility rules**\r\n", "\r\n", "This command assess the single databse using authentication as Windows and save the result in specified path.\r\n", "It requires Sql Server name & Database name in order to assess" ], "metadata": { "azdata_cell_guid": "146181e8-c0e5-4fab-b4a4-40276762ff9f" } }, { "cell_type": "code", "source": [ "& $ExecutableFile /AssessmentName=$AssessmentName /AssessmentDatabases=\"Server=$Server;Initial Catalog=$InitialCatalog;Integrated Security=true\" /AssessmentEvaluateCompatibilityIssues /AssessmentOverwriteResult /AssessmentResultJson=$ResultPath" ], "metadata": { "azdata_cell_guid": "c3abe0ea-e971-4058-9c85-9f2d909a9291" }, "outputs": [], "execution_count": null }, { "cell_type": "markdown", "source": [ "_Get-Content_ cmdlet gets the content of the item at the location specified by the path, such as the text in a file or the content of a function. For files, the content is read one line at a time and returns a collection of objects, each of which represents a line of content." ], "metadata": { "azdata_cell_guid": "4b1c8811-8b78-4543-bfa3-f4879510795b" } }, { "cell_type": "code", "source": [ "Get-Content -Path $ResultPath" ], "metadata": { "azdata_cell_guid": "7e69969a-0d53-4a00-830c-3ed41318234a" }, "outputs": [], "execution_count": null } ] }