dbatools is a free PowerShell module with over 200 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


This command shows if you can migrate one or more database(s) between instances.

Which versions and editions are supported by this function?

This function only validate SQL Server 2008 versions or higher.
The editions supported by this function are:

  • Enterprise
  • Developer
  • Evaluation
  • Standard
  • Express


How it is validated?

The validation will be made using the ‘sys.dm_db_persisted_sku_features‘ dynamic management view to list all edition-specific features that are enabled in the current database.

But, since last November 2016, we have SQL Server 2016 SP1…

and this version brought great news!
Now, almost every edition can run every single feature. This means, for example, that you can use ‘Compression’ feature on Express edition!

“Almost” because there are very few ones that are not supported on lower editions (Express and LocalDB).
You can find more information at Microsoft SQL Server 2016 Service Pack 1 (SP1) released !!! blog post.

The good news is this command is SQL Server 2016 SP1 aware!


Verify if databases can be migrated from sql2012 (Enterprise) to sql2016 (RTM Standard Edition) instance.






Verify if databases can be migrated from sql2012 (Enterprise) to sql2016 SP1 Express Edition instance.


Verify if database DBWithCDC can be migrated from sql2016 SP1 Standard to sql2016 SP1 Express Edition.






Verify if databases can be migrated from sql2016 SP1 Standard to sql2016 RTM Standard Edition.





Verify all databases for features in use that can’t be used on the destination instance using SQL credentials for sqlserver2014a and Windows credentials for sqlcluster.

Test-SqlMigrationConstraint -Source sqlserver2014a -Destination sqlcluster -SqlCredential $cred

Verify only database ‘DBWithCompression’ for features in use that can’t be supported on the destination instance

Test-SqlMigrationConstraint -Source sql2016 -Destination sql2016
\sqlexpress -Databases DBWithCompression



This command was created by Cláudio Silva. You can find Cláudio on Twitter and LinkedIn.


From PowerShell, execute Get-Help Test-SqlMigrationConstraint -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-SqlMigrationConstraint.ps1 on GitHub

Related commands