< Back

Test-DbaMigrationConstraint

Mon Jan 13, 2020 6:14 pm

NAME Test-DbaMigrationConstraint



SYNOPSIS

Show if you can migrate the database(s) between the servers.





SYNTAX

Test-DbaMigrationConstraint [-Source] <DbaInstanceParameter> [[-SourceSqlCredential] <Pscredential>]

[-Destination] <DbaInstanceParameter> [[-DestinationSqlCredential] <Pscredential>] [[-Database] <System.Object[]>]

[[-ExcludeDatabase] <System.Object[]>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

When you want to migrate from a higher edition to a lower one there are some features that can't be used.



This function will validate if you have any of this features in use and will report to you.



The validation will be made ONLY on on SQL Server 2008 or higher using the 'sys.dm_db_persisted_sku_features' dmv.



This function only validate SQL Server 2008 versions or higher.



The editions supported by this function are:



- Enterprise



- Developer



- Evaluation



- Standard



- Express



Take into account the new features introduced on SQL Server 2016 SP1 for all versions. More information at

https://blogs.msdn.microsoft.com/sqlrel ... -released/



The -Database parameter is auto-populated for command-line completion.





PARAMETERS

-Database [<System.Object[]>]

The database(s) to process. Options for this list are auto-populated from the server. If unspecified, all

databases will be processed.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Destination [<DbaInstanceParameter>]

Destination SQL Server. You must have sysadmin access and the server must be SQL Server 2000 or higher.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-DestinationSqlCredential [<Pscredential>]

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).



Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory -

Integrated are all supported.



For MFA support, please use Connect-DbaInstance.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-EnableException [<Switch>]

By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.

This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables

advanced scripting.

Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own

try/catch.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-ExcludeDatabase [<System.Object[]>]

The database(s) to exclude. Options for this list are auto-populated from the server.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Source [<DbaInstanceParameter>]

Source SQL Server. You must have sysadmin access and server version must be SQL Server version 2000 or higher.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-SourceSqlCredential [<Pscredential>]

Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).



Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory -

Integrated are all supported.



For MFA support, please use Connect-DbaInstance.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Migration

Author: Claudio Silva (@ClaudioESSilva)



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Test-DbaMigrationConstraint -Source sqlserver2014a -Destination sqlcluster



All databases on sqlserver2014a will be verified for features in use that can't be supported on sqlcluster.

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Test-DbaMigrationConstraint -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred



All databases will be verified for features in use that can't be supported on the destination server. SQL

credentials are used to authenticate against sqlserver2014a and Windows Authentication is used for sqlcluster.

-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Test-DbaMigrationConstraint -Source sqlserver2014a -Destination sqlcluster -Database db1



Only db1 database will be verified for features in use that can't be supported on the destination server.



RELATED LINKS

https://dbatools.io/Test-DbaMigrationConstraint