0

如何将 SQL Server 实例从本地实例迁移到 Azure VM SQL Server 实例?

寻求专家支持解决以下问题。

设想:

本地实例:SQLSRV01

Azure 虚拟机:23.96.20.20

-本地 SQL SERVER 和 Azure VM SQL SERVER 实例为 SQLSERVER 2017 (14.0)

-为sql server添加了入站端口规则

-SharedPath 可从双方访问(本地计算机以及 Azure VM:23.96.20.20)

-DBSERVER17 实例可从本地计算机访问和连接

-相同的命令在我的本地计算机上运行良好,有两个不同的 SQL SERVER 实例。

电源外壳脚本:

 $params = @{
 Source = "SQLSRV01"
 Destination = "23.96.20.20"
 SharedPath = "Z:"
 BackupRestore = $true
 }
  Start-DbaMigration @params -Force | Select * | Out-GridView

收到的输出:

PS C:\WINDOWS\system32> E:\PowerShellScripts\RemoteInstance.ps1
WARNING: [16:05:58][Copy-DbaSpConfigure] Error occurred while establishing connection to 23.96.20.20 | The wait operat
ion timed out
WARNING: [16:06:15][Copy-DbaCustomError] Error occurred while establishing connection to 23.96.20.20 | The wait operat
ion timed out
WARNING: [16:06:15][Copy-DbaCredential] Console not elevated, but elevation is required to perform some actions on loc
alhost for this command.
WARNING: [16:06:15][Copy-DbaDbMail] Error occurred while establishing connection to 23.96.20.20 | The wait operation t
imed out
WARNING: [16:06:15][Copy-DbaRegServer] Error occurred while establishing connection to 23.96.20.20 | The wait operatio
n timed out
WARNING: [16:06:15][Copy-DbaBackupDevice] Error occurred while establishing connection to 23.96.20.20 | The wait opera
tion timed out
WARNING: [16:06:15][Copy-DbaInstanceTrigger] Error occurred while establishing connection to 23.96.20.20 | The wait op
eration timed out
WARNING: [16:06:15][Copy-DbaDatabase] Error occurred while establishing connection to 23.96.20.20 | The wait operation
 timed out
WARNING: [16:06:15][Copy-DbaLogin] Error occurred while establishing connection to 23.96.20.20 | The wait operation ti
med out
The wait operation timed out
At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.113\allcommands.ps1:83435 char:9
         throw $records[0]
         ~~~~~~~~~~~~~~~~~
     CategoryInfo          : NotSpecified: (:) [], Exception
     FullyQualifiedErrorId : dbatools_Connect-DbaInstance
4

1 回答 1

1

提供的参数 $scred, $dcred 然后将 $scred 对象传递给 SourceSqlCredential 并将 $dcred 对象传递给 DestinationSqlCredential 就是这样。

  $scred = Get-Credential
  $dcred = Get-Credential
  $params = @{
  Source = "SQLSRV01"
  Destination = "23.96.20.20"
  SourceSqlCredential = $scred
  DestinationSqlCredential =$dcred
  SharedPath = "\\SharedDB"
  BackupRestore = $true
  }
   Start-DbaMigration @params -Force | Select * | Out-GridView
于 2020-07-16T05:47:44.813 回答