Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Copy-DbaDataCollector on GitHub.
Want to see the Bill Of Health for this command? Check out Copy-DbaDataCollector.
Migrates user SQL Data Collector collection sets. SQL Data Collector configuration is on the agenda, but it's hard.
By default, all data collector objects are migrated. If the object already exists on the destination, it will be skipped unless -Force is used.
The -CollectionSet parameter is auto-populated for command-line completion and can be used to copy only specific objects.
Copy-DbaDataCollector
[-Source] <DbaInstanceParameter>
[[-SourceSqlCredential] <PSCredential>]
[-Destination] <DbaInstanceParameter[]>
[[-DestinationSqlCredential] <PSCredential>]
[[-CollectionSet] <Object[]>]
[[-ExcludeCollectionSet] <Object[]>]
[-NoServerReconfig]
[-Force]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Copy-DbaDataCollector -Source sqlserver2014a -Destination sqlcluster
Copies all Data Collector Objects and Configurations from sqlserver2014a to sqlcluster, using Windows credentials.
PS C:\> Copy-DbaDataCollector -Source sqlserver2014a -Destination sqlcluster -SourceSqlCredential $cred
Copies all Data Collector Objects and Configurations from sqlserver2014a to sqlcluster, using SQL credentials for sqlserver2014a and Windows credentials for sqlcluster.
PS C:\> Copy-DbaDataCollector -Source sqlserver2014a -Destination sqlcluster -WhatIf
Shows what would happen if the command were executed.
PS C:\> Copy-DbaDataCollector -Source sqlserver2014a -Destination sqlcluster -CollectionSet 'Server Activity', 'Table Usage Analysis'
Copies two Collection Sets, Server Activity and Table Usage Analysis, from sqlserver2014a to sqlcluster.
Source SQL Server. You must have sysadmin access and server version must be SQL Server version 2008 or higher.
Alias | |
Required | True |
Pipeline | false |
Default Value |
Destination Sql Server. You must have sysadmin access and server version must be SQL Server version 2008 or higher.
Alias | |
Required | True |
Pipeline | false |
Default Value |
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.
Alias | |
Required | False |
Pipeline | false |
Default Value |
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.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The collection set(s) to process - this list is auto-populated from the server. If unspecified, all collection sets will be processed.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The collection set(s) to exclude - this list is auto-populated from the server
Alias | |
Required | False |
Pipeline | false |
Default Value |
Upcoming parameter to enable server reconfiguration
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
If collection sets exists on destination server, it will be dropped and recreated.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
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.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Shows what would happen if the command were to run. No actions are actually performed.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
Prompts you for confirmation before executing any changing operations within the command.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |