Skip to content

Commit

Permalink
removed warnings from migrations since they're basically repeats
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Oct 27, 2017
1 parent ccea650 commit c42df4f
Show file tree
Hide file tree
Showing 24 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions functions/Copy-DbaAgentAlert.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function Copy-DbaAgentAlert {

if ($destAlerts.name -contains $serverAlert.name) {
if ($force -eq $false) {
$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentAlertStatus
Write-Message -Message "Alert [$alertName] exists at destination. Use -Force to drop and migrate." -Level Verbose
continue
Expand All @@ -185,22 +185,22 @@ function Copy-DbaAgentAlert {
if ($destSevConflict) {
Write-Message -Level Verbose -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity). Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentAlertStatus
continue
}
if ($destSevDbConflict) {
Write-Message -Level Verbose -Message "Alert [$($destSevConflict.Name)] has already been defined to use the severity $($serverAlert.Severity) on database $($severAlert.DatabaseName). Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentAlertStatus
continue
}

if ($serverAlert.JobName -and $destServer.JobServer.Jobs.Name -NotContains $serverAlert.JobName) {
Write-Message -Level Verbose -Message "Alert [$alertName] has job [$($serverAlert.JobName)] configured as response. The job does not exist on destination $destServer. Skipping."

$copyAgentAlertStatus.Status = "Skipped"
$copyAgentAlertStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentAlertStatus
continue
}
Expand Down
6 changes: 3 additions & 3 deletions functions/Copy-DbaAgentCategory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function Copy-DbaAgentCategory {

if ($destJobCategories.Name -contains $jobCategory.name) {
if ($force -eq $false) {
$copyJobCategoryStatus.Status = "Skipped"
$copyJobCategoryStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobCategoryStatus
Write-Message -Level Verbose -Message "Job category $categoryName exists at destination. Use -Force to drop and migrate."
continue
Expand Down Expand Up @@ -221,7 +221,7 @@ function Copy-DbaAgentCategory {

if ($destOperatorCategories.Name -contains $operatorCategory.Name) {
if ($force -eq $false) {
$copyOperatorCategoryStatus.Status = "Skipped"
$copyOperatorCategoryStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyOperatorCategoryStatus
Write-Message -Level Verbose -Message "Operator category $categoryName exists at destination. Use -Force to drop and migrate."
continue
Expand Down Expand Up @@ -306,7 +306,7 @@ function Copy-DbaAgentCategory {

if ($destAlertCategories.Name -contains $alertCategory.name) {
if ($force -eq $false) {
$copyAlertCategoryStatus.Status = "Skipped"
$copyAlertCategoryStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAlertCategoryStatus
Write-Message -Level Verbose -Message "Alert category $categoryName exists at destination. Use -Force to drop and migrate."
continue
Expand Down
12 changes: 6 additions & 6 deletions functions/Copy-DbaAgentJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function Copy-DbaAgentJob {
$MaintenancePlanName = $sourceServer.Query($sql).MaintenancePlanName

if ($MaintenancePlanName) {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job is associated with maintenance plan"
$copyJobStatus
Write-Message -Level Verbose -Message "Job [$jobName] is associated with Maintenance Plan: $MaintenancePlanName"
Expand All @@ -159,7 +159,7 @@ function Copy-DbaAgentJob {

if ($missingDb.Count -gt 0 -and $dbNames.Count -gt 0) {
$missingDb = ($missingDb | Sort-Object | Get-Unique) -join ", "
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job is dependent on database: $missingDb"
$copyJobStatus
Write-Message -Level Verbose -Message "Database(s) $missingDb doesn't exist on destination. Skipping job [$jobName]."
Expand All @@ -171,7 +171,7 @@ function Copy-DbaAgentJob {
if ($missingLogin.Count -gt 0) {
if ($force -eq $false) {
$missingLogin = ($missingLogin | Sort-Object | Get-Unique) -join ", "
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job is dependent on login $missingLogin"
$copyJobStatus
Write-Message -Level Verbose -Message "Login(s) $missingLogin doesn't exist on destination. Use -Force to set owner to [sa]. Skipping job [$jobName]."
Expand All @@ -184,7 +184,7 @@ function Copy-DbaAgentJob {

if ($missingProxy.Count -gt 0 -and $proxyNames.Count -gt 0) {
$missingProxy = ($missingProxy | Sort-Object | Get-Unique) -join ", "
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job is dependent on proxy $($proxyNames[0])"
$copyJobStatus
Write-Message -Level Verbose -Message "Proxy Account(s) $($proxyNames[0]) doesn't exist on destination. Skipping job [$jobName]."
Expand All @@ -196,7 +196,7 @@ function Copy-DbaAgentJob {

if ($missingOperators.Count -gt 0 -and $operators.Count -gt 0) {
$missingOperator = ($operators | Sort-Object | Get-Unique) -join ", "
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job is dependent on operator $missingOperator"
$copyJobStatus
Write-Message -Level Verbose -Message "Operator(s) $($missingOperator) doesn't exist on destination. Skipping job [$jobName]"
Expand All @@ -205,7 +205,7 @@ function Copy-DbaAgentJob {

if ($destJobs.name -contains $serverJob.name) {
if ($force -eq $false) {
$copyJobStatus.Status = "Skipped"
$copyJobStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyJobStatus.Notes = "Job already exist on destination"
$copyJobStatus
Write-Message -Level Verbose -Message "Job $jobName exists at destination. Use -Force to drop and migrate."
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaAgentOperator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Copy-DbaAgentOperator {

if ($destOperator.Name -contains $sOperator.Name) {
if ($force -eq $false) {
$copyOperatorStatus.Status = "Skipped"
$copyOperatorStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyOperatorStatus
Write-Message -Level Verbose -Message "Operator $operatorName exists at destination. Use -Force to drop and migrate."
continue
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaAgentProxyAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function Copy-DbaAgentProxyAccount {
}

if ($null -eq $credentialtest) {
$copyAgentProxyAccountStatus.Status = "Skipped"
$copyAgentProxyAccountStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentProxyAccountStatus
Write-Message -Level Verbose -Message "Associated credential account, $CredentialName, does not exist on $destination. Skipping migration of $proxyName."
continue
Expand All @@ -142,7 +142,7 @@ function Copy-DbaAgentProxyAccount {
$copyAgentProxyAccountStatus.Type = "ProxyAccount"

if ($force -eq $false) {
$copyAgentProxyAccountStatus.Status = "Skipped"
$copyAgentProxyAccountStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyAgentProxyAccountStatus
Write-Message -Level Verbose -Message "Server proxy account $proxyName exists at destination. Use -Force to drop and migrate."
continue
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaAgentSharedSchedule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ function Copy-DbaAgentSharedSchedule {

if ($destSchedules.Name -contains $scheduleName) {
if ($force -eq $false) {
$copySharedScheduleStatus.Status = "Skipped"
$copySharedScheduleStatus.Status = "Skipped. Use -Force to drop and migrate."
$copySharedScheduleStatus
Write-Message -Level Verbose -Message "Shared job schedule $scheduleName exists at destination. Use -Force to drop and migrate."
continue
}
else {
if ($destServer.JobServer.Jobs.JobSchedules.Name -contains $scheduleName) {
$copySharedScheduleStatus.Status = "Skipped"
$copySharedScheduleStatus.Status = "Skipped. Use -Force to drop and migrate."
$copySharedScheduleStatus
Write-Message -Level Verbose -Message "Schedule [$scheduleName] has associated jobs. Skipping."
continue
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaBackupDevice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Copy-DbaBackupDevice {

if ($destBackupDevices.Name -contains $deviceName) {
if ($force -eq $false) {
$copyBackupDeviceStatus.Status = "Skipped"
$copyBackupDeviceStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyBackupDeviceStatus

Write-Message -Level Verbose -Message "backup device $deviceName exists at destination. Use -Force to drop and migrate."
Expand Down
8 changes: 4 additions & 4 deletions functions/Copy-DbaCentralManagementServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Copy-DbaCentralManagementServer {

if ($null -ne $destinationGroup) {
if ($force -eq $false) {
$copyDestinationGroupStatus.Status = "Skipped"
$copyDestinationGroupStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDestinationGroupStatus
Write-Message -Level Verbose -Message "Destination group $groupName exists at destination. Use -Force to drop and migrate."
continue
Expand Down Expand Up @@ -172,7 +172,7 @@ function Copy-DbaCentralManagementServer {
Write-Message -Level Verbose -Message "SwitchServerName was used and new CMS equals current server name. $($toCmStore.DomainInstanceName.ToLower()) changed to $serverName."
}
else {
$copyInstanceStatus.Status = "Skipped"
$copyInstanceStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyInstanceStatus

Write-Message -Level Verbose -Message "$serverName is Central Management Server. Add prohibited. Skipping."
Expand All @@ -182,7 +182,7 @@ function Copy-DbaCentralManagementServer {

if ($destinationGroup.RegisteredServers.Name -contains $instanceName) {
if ($force -eq $false) {
$copyInstanceStatus.Status = "Skipped"
$copyInstanceStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyInstanceStatus

Write-Message -Level Verbose -Message "Instance $instanceName exists in group $groupName at destination. Use -Force to drop and migrate."
Expand Down Expand Up @@ -249,7 +249,7 @@ function Copy-DbaCentralManagementServer {

if ($null -ne $toSubGroup) {
if ($force -eq $false) {
$copyGroupStatus.Status = "Skipped"
$copyGroupStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyGroupStatus

Write-Message -Level Verbose -Message "Subgroup $fromSubGroupName exists at destination. Use -Force to drop and migrate."
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaCustomError.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function Copy-DbaCustomError {

if ($destCustomErrors.ID -contains $customErrorId) {
if ($force -eq $false) {
$copyCustomErrorStatus.Status = "Skipped"
$copyCustomErrorStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyCustomErrorStatus

Write-Message -Level Verbose -Message "Custom error $customErrorId $language exists at destination. Use -Force to drop and migrate."
Expand Down
12 changes: 6 additions & 6 deletions functions/Copy-DbaDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ function Copy-DbaDatabase {
if ($currentdb.IsAccessible -eq $false) {
Write-Message -Level Verbose -Message "Skipping $dbName. Database is inaccessible."

$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Database is not accessible."
$copyDatabaseStatus
continue
Expand All @@ -941,7 +941,7 @@ function Copy-DbaDatabase {

if ($fsRows.Count -gt 0) {
Write-Message -Level Verbose -Message "Skipping $dbName (contains FILESTREAM)."
$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Contains FILESTREAM"
$copyDatabaseStatus
continue
Expand Down Expand Up @@ -975,7 +975,7 @@ function Copy-DbaDatabase {
if ($dbStatus.StartsWith("Normal") -eq $false) {
Write-Message -Level Verbose -Message "$dbName is not in a Normal state. Skipping."

$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Not in normal state"
$copyDatabaseStatus
continue
Expand All @@ -984,7 +984,7 @@ function Copy-DbaDatabase {
if ($currentdb.ReplicationOptions -ne "None" -and $DetachAttach -eq $true) {
Write-Message -Level Verbose -Message "$dbName is part of replication. Skipping."

$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Part of replication"
$copyDatabaseStatus
continue
Expand All @@ -993,7 +993,7 @@ function Copy-DbaDatabase {
if ($currentdb.IsMirroringEnabled -and !$force -and $DetachAttach) {
Write-Message -Level Verbose -Message "Database is being mirrored. Use -Force to break mirror and migrate. Alternatively, you can use the safer backup/restore method."

$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Database is mirrored. Use -Force to break mirror."
$copyDatabaseStatus
continue
Expand All @@ -1002,7 +1002,7 @@ function Copy-DbaDatabase {
if (($destServer.Databases[$dbName] -ne $null) -and !$force -and !$WithReplace) {
Write-Message -Level Verbose -Message "Database exists at destination. Use -Force to drop and migrate. Aborting routine for this database."

$copyDatabaseStatus.Status = "Skipped"
$copyDatabaseStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDatabaseStatus.Notes = "Already exist on destination"
$copyDatabaseStatus
continue
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaDatabaseAssembly.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function Copy-DbaDatabaseAssembly {


if (!$destDb) {
$copyDbAssemblyStatus.Status = "Skipped"
$copyDbAssemblyStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDbAssemblyStatus

Write-Message -Level Verbose -Message "Destination database $dbName does not exist. Skipping $assemblyName.";
Expand Down Expand Up @@ -181,7 +181,7 @@ function Copy-DbaDatabaseAssembly {

if ($destServer.Databases[$dbName].Assemblies.Name -contains $currentAssembly.name) {
if ($force -eq $false) {
$copyDbAssemblyStatus.Status = "Skipped"
$copyDbAssemblyStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyDbAssemblyStatus

Write-Message -Level Verbose -Message "Assembly $assemblyName exists at destination in the $dbName database. Use -Force to drop and migrate."
Expand Down
6 changes: 3 additions & 3 deletions functions/Copy-DbaDatabaseMail.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Copy-DbaDatabaseMail {

if ($destAccounts.name -contains $accountName) {
if ($force -eq $false) {
$copyMailAccountStatus.Status = "Skipped"
$copyMailAccountStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyMailAccountStatus
Write-Message -Message "Account $accountName exists at destination. Use -Force to drop and migrate." -Level Verbose
continue
Expand Down Expand Up @@ -212,7 +212,7 @@ function Copy-DbaDatabaseMail {

if ($destProfiles.name -contains $profileName) {
if ($force -eq $false) {
$copyMailProfileStatus.Status = "Skipped"
$copyMailProfileStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyMailProfileStatus
Write-Message -Message "Profile $profileName exists at destination. Use -Force to drop and migrate." -Level Verbose
continue
Expand Down Expand Up @@ -273,7 +273,7 @@ function Copy-DbaDatabaseMail {

if ($destMailServers.name -contains $mailServerName) {
if ($force -eq $false) {
$copyMailServerStatus.Status = "Skipped"
$copyMailServerStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyMailServerStatus
Write-Message -Message "Mail server $mailServerName exists at destination. Use -Force to drop and migrate." -Level Verbose
continue
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaEndpoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function Copy-DbaEndpoint {

if ($destEndpoints.Name -contains $endpointName) {
if ($force -eq $false) {
$copyEndpointStatus.Status = "Skipped"
$copyEndpointStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyEndpointStatus

Write-Message -Level Verbose -Message "Server endpoint $endpointName exists at destination. Use -Force to drop and migrate."
Expand Down
2 changes: 1 addition & 1 deletion functions/Copy-DbaExtendedEvent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function Copy-DbaExtendedEvent {

if ($destStore.Sessions[$sessionName] -ne $null) {
if ($force -eq $false) {
$copyXeSessionStatus.Status = "Skipped"
$copyXeSessionStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyXeSessionStatus

Write-Message -Level Verbose -Message "Extended Event Session '$sessionName' was skipped because it already exists on $destination."
Expand Down
4 changes: 2 additions & 2 deletions functions/Copy-DbaLinkedServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function Copy-DbaLinkedServer {
# This does a check to warn of missing OleDbProviderSettings but should only be checked on SQL on Windows
if ($destServer.Settings.OleDbProviderSettings.Name.Length -ne 0) {
if (!$destServer.Settings.OleDbProviderSettings.Name -contains $provider -and !$provider.StartsWith("SQLN")) {
$copyLinkedServer.Status = "Skipped"
$copyLinkedServer.Status = "Skipped. Use -Force to drop and migrate."
$copyLinkedServer

Write-Message -Level Verbose -Message "$($destServer.Name) does not support the $provider provider. Skipping $linkedServerName."
Expand All @@ -313,7 +313,7 @@ function Copy-DbaLinkedServer {

if ($destServer.LinkedServers[$linkedServerName] -ne $null) {
if (!$force) {
$copyLinkedServer.Status = "Skipped"
$copyLinkedServer.Status = "Skipped. Use -Force to drop and migrate."
$copyLinkedServer

Write-Message -Level Verbose -Message "$linkedServerName exists $($destServer.Name). Skipping."
Expand Down
10 changes: 5 additions & 5 deletions functions/Copy-DbaLogin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function Copy-DbaLogin {
Write-Message -Level Verbose -Message "Cannot drop login performing the migration. Skipping."
}

$copyLoginStatus.Status = "Skipped"
$copyLoginStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyLoginStatus.Notes = "Login doing migration"
$copyLoginStatus
continue
Expand All @@ -202,7 +202,7 @@ function Copy-DbaLogin {
Write-Message -Level Verbose -Message "$userName was skipped because it is a local machine name."
}

$copyLoginStatus.Status = "Skipped"
$copyLoginStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyLoginStatus.Notes = "local machine name"
$copyLoginStatus
continue
Expand All @@ -219,7 +219,7 @@ function Copy-DbaLogin {
Write-Message -Level Verbose -Message "$userName already exists in destination. Use -Force to drop and recreate."
}

$copyLoginStatus.Status = "Skipped"
$copyLoginStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyLoginStatus.Notes = "Already exists on destination."
$copyLoginStatus
continue
Expand All @@ -229,7 +229,7 @@ function Copy-DbaLogin {
if ($userName -eq $destServer.ServiceAccount) {
Write-Message -Level Verbose -Message "$userName is the destination service account. Skipping drop."

$copyLoginStatus.Status = "Skipped"
$copyLoginStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyLoginStatus.Notes = "Destination service account"
$copyLoginStatus
continue
Expand Down Expand Up @@ -420,7 +420,7 @@ function Copy-DbaLogin {
else {
Write-Message -Level Verbose -Message "$($sourceLogin.LoginType) logins not supported. $($sourceLogin.name) skipped."

$copyLoginStatus.Status = "Skipped"
$copyLoginStatus.Status = "Skipped. Use -Force to drop and migrate."
$copyLoginStatus.Notes = "$($sourceLogin.LoginType) not supported"
$copyLoginStatus

Expand Down
Loading

0 comments on commit c42df4f

Please sign in to comment.