Permalink
Browse files

Start-DbaMigration xplat fixes (#4771)

* fix linux support
  • Loading branch information...
potatoqualitee committed Dec 5, 2018
1 parent a5b0683 commit 55a8ef3a0e8ed2b772133f4a640dc9e545aebc0e
@@ -1044,7 +1044,6 @@ $script:xplat = @(
'Copy-DbaServerRole',
'Copy-DbaResourceGovernor',
'Copy-DbaXESession',
'Copy-DbaBackupDevice',
'Copy-DbaServerTrigger',
'Copy-DbaCmsRegServer',
'Copy-DbaSysDbUserObject',
@@ -1425,6 +1424,7 @@ $script:noncoresmo = @(
)
$script:windowsonly = @(
# solvable filesystem issues or other workarounds
'Copy-DbaBackupDevice',
'Install-DbaSqlWatch',
'Uninstall-DbaSqlWatch',
'Get-DbaRegistryRoot',
@@ -80,6 +80,10 @@ function Copy-DbaBackupDevice {
[switch]$EnableException
)
begin {
if (-not $script:isWindows) {
Stop-Function -Message "Copy-DbaBackupDevice does not support Linux yet though it looks doable"
return
}
try {
$sourceServer = Connect-SqlInstance -SqlInstance $Source -SqlCredential $SourceSqlCredential
} catch {
@@ -163,7 +167,7 @@ function Copy-DbaBackupDevice {
Write-Message -Level Verbose -Message "Checking if directory $destPath exists"
if ($(Test-DbaPath -SqlInstance $destinstance -Path $path) -eq $false) {
if ($(Test-DbaPath -SqlInstance $destServer -Path $path) -eq $false) {
$backupDirectory = $destServer.BackupDirectory
$destPath = Join-AdminUnc $destNetBios $backupDirectory
@@ -88,6 +88,11 @@ function Copy-DbaCmsRegServer {
[switch]$EnableException
)
begin {
if (-not $script:isWindows) {
Stop-Function -Message "Copy-DbaCmsRegServer does not support Linux - we're still waiting for the Core SMOs from Microsoft"
return
}
Test-DbaDeprecation -DeprecatedOn "1.0.0" -Alias Copy-DbaCentralManagementServer
function Invoke-ParseServerGroup {
[cmdletbinding()]
@@ -95,6 +95,10 @@ function Copy-DbaDataCollector {
[switch]$EnableException
)
begin {
if (-not $script:isWindows) {
Stop-Function -Message "Copy-DbaDataCollector does not support Linux - we're still waiting for the Core SMOs from Microsoft"
return
}
try {
$sourceServer = Connect-SqlInstance -SqlInstance $Source -SqlCredential $SourceSqlCredential -MinimumVersion 10
} catch {
@@ -278,7 +278,7 @@ function Copy-DbaDatabase {
)
if ($script:sameserver) {
if ($script:sameserver -or (-not $script:isWindows)) {
return $filepath
}
if (-not $filepath) {
@@ -800,23 +800,6 @@ function Copy-DbaDatabase {
Stop-Function -Message "Source and Destination SQL Servers instances are the same. Quitting." -Continue
}
if ($SharedPath) {
Write-Message -Level Verbose -Message "Checking to ensure network path is valid."
if (-not ($SharedPath.StartsWith("\\")) -and -not $script:sameserver) {
Stop-Function -Message "Network share must be a valid UNC path (\\server\share)." -Continue
}
if (-not $script:sameserver) {
try {
if ((Test-Path $SharedPath -ErrorAction Stop)) {
Write-Message -Level Verbose -Message "$SharedPath share can be accessed."
}
} catch {
Write-Message -Level Verbose -Message "$SharedPath share cannot be accessed. Still trying anyway, in case the SQL Server service accounts have access."
}
}
}
Write-Message -Level Verbose -Message "Checking to ensure server is not SQL Server 7 or below."
if ($sourceServer.VersionMajor -lt 8 -and $destServer.VersionMajor -lt 8) {
Stop-Function -Message "This script can only be run on SQL Server 2000 and above. Quitting." -Continue
@@ -98,8 +98,12 @@ function Copy-DbaPolicyManagement {
[Alias('Silent')]
[switch]$EnableException
)
begin {
if (-not $script:isWindows) {
Stop-Function -Message "Copy-DbaPolicyManagement does not support Linux - we're still waiting for the Core SMOs from Microsoft"
return
}
try {
$sourceServer = Connect-SqlInstance -SqlInstance $Source -SqlCredential $SourceSqlCredential -MinimumVersion 10
} catch {
@@ -19,7 +19,7 @@ function Update-SqlDbOwner {
)
$sourceServer = Connect-SqlInstance -SqlInstance $Source -SqlCredential $SourceSqlCredential
$destServer = Connect-SqlInstance -SqlInstance $Destination -SqlCredential $SqlCredential
$destServer = Connect-SqlInstance -SqlInstance $Destination -SqlCredential $DestinationSqlCredential
$source = $sourceServer.DomainInstanceName
$destination = $destServer.DomainInstanceName

0 comments on commit 55a8ef3

Please sign in to comment.