将bacpac文件还原到SQL Server 2014 CTP2时“无法连接到目标服务器”

时间:2021-05-03 02:43:26

I'm getting the following error message when trying to restore a (known good) .bacpac file to a new SQL Server 2014 (Express) instance through the "Import Data-tier Application" wizard:

尝试通过“导入数据层应用程序”向导将(已知的).bacpac文件还原到新的SQL Server 2014(Express)实例时,我收到以下错误消息:

===================================

Unable to connect to target server. (Microsoft.Data.Tools.Schema.Sql)

无法连接到目标服务器。 (Microsoft.Data.Tools.Schema.Sql)


Program Location:

at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnInit(ErrorManager errors, String targetDBName) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment..ctor(SqlDeploymentConstructor constructor) at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentConstructor.ConstructServiceImplementation() at Microsoft.SqlServer.Dac.DacServices.CreatePackageToDatabaseDeployment(String connectionString, IPackageSource packageSource, String targetDatabaseName, DacAzureDatabaseSpecification creationDefaults, DacDeployOptions options, ErrorManager errorManager) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.<>c__DisplayClass5.b__1() at Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action) at Microsoft.SqlServer.Dac.DeployOperation.<>c__DisplayClass3.b__0(Object operation, CancellationToken token) at Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.ReportMessageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context) at Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)

Microsoft.Data.Tools上的Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment..ctor(SqlDeploymentConstructor构造函数)中的Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnInit(ErrorManager错误,String targetDBName) Microsoft.SqlServer.Dac.DeployOperation上的Microsoft.SqlServer.Dac.DacServices.CreatePackageToDatabaseDeployment(String connectionString,IPackageSource packageSource,String targetDatabaseName,DacAzureDatabaseSpecification creationDefaults,DacDeployOptions options,ErrorManager errorManager)中的.Schema.Sql.Deployment.SqlDeploymentConstructor.ConstructServiceImplementation()。 <> c__DisplayClass3。<> c__DisplayClass5.b__1(),位于Microsoft.SDataServer.DacloyOperation的Microsoft.Data.Tools.Schema.Sql.Dac.OperationLogger.Capture(Action action)。<> c__DisplayClass3.b__0(对象操作,CancellationToken在Microsoft.SqlServer.Dac.ReportMe的Microsoft.SqlServer.Dac.Operation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)处。 Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation上的Microsoft.SqlServer.Dac.OperationExtension.CompositeOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)中的ssageOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)。 Microsoft.SqlServer.Dac.DeployOperation.Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)中的Microsoft.SqlServer.Dac.IOperation.Run(OperationContext context)

The error specifically doesn't make sense because it successfully creates the database, as reported here (and manually confirmed). It just doesn't import the data.

该错误具体没有意义,因为它成功创建了数据库,如此处所报告(并手动确认)。它只是不导入数据。

将bacpac文件还原到SQL Server 2014 CTP2时“无法连接到目标服务器”

Googling hasn't turned up anything. Anybody else run into this? Any workarounds? Give up and go back to 2012?

谷歌搜索没有发现任何东西。还有其他人碰到这个吗?有任何变通方法吗?放弃并回到2012年?

4 个解决方案

#1


2  

I never did figure this out, but uninstalling 2014 and dropping back to 2012 seemed to fix it. For now, I'm chalking it up to a bug in 2014. It's not even at the beta stage yet, so I suppose it's not surprising that there are still significant bugs. (Still, isn't it interesting how so many other companies manage to release software on a much more aggressive schedule than MS, with each release being so much more stable?)

我从来没有弄清楚这一点,但卸载2014年并回到2012年似乎解决了这个问题。现在,我正在粉碎它到2014年的一个错误。它还没有处于测试阶段,所以我认为仍然存在重大错误并不奇怪。 (仍然,有多少其他公司设法以比MS更激进的方式发布软件并不是很有趣,每个版本都更加稳定吗?)

#2


1  

I had same problem with SQL Server 2016RC2, export data from SQL Server 2014 and try to import on 2016RC2. For export and import I used SQL Management Studio 2014. That was the problem. When I installed SQL Management Studio 2016RC2 and use it for import the problem disappeared. In my case it was important to use same version of SQL Management Studio as the server on which the data is imported.

我遇到了与SQL Server 2016RC2相同的问题,从SQL Server 2014导出数据并尝试在2016RC2上导入。对于导出和导入,我使用了SQL Management Studio 2014.这就是问题所在。当我安装SQL Management Studio 2016RC2并将其用于导入时,问题就消失了。在我的情况下,使用相同版本的SQL Management Studio作为导入数据的服务器非常重要。

#3


0  

I had the same error, trying to import an export file from a V11 Azure db into a V12 localdb. Importing into the same version db (V11) worked. So my problem was mismatched versions.

我有同样的错误,尝试将导出文件从V11 Azure数据库导入到V12 localdb。导入到相同版本的db(V11)有效。所以我的问题是版本不匹配。

#4


0  

I updated my version of SQL Management Studio to v17.8.1 and restores started working with no errors. I've found BACPAC restores have worked best when I run the latest SSMS. If you're not running 17.x or higher, the "Check for updates" feature will NOT tell you 17.x is available, so don't rely on that feature :)

我将我的SQL Management Studio版本更新到v17.8.1并恢复开始工作没有错误。我发现当我运行最新的SSMS时,BACPAC恢复效果最好。如果你没有运行17.x或更高版本,“检查更新”功能将不会告诉你17.x可用,所以不要依赖于该功能:)

Here's a link to the download:

这是下载的链接:

https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017

Also, make sure you're running the latest and/or matching version of SQL Server. It should be at least the version of SQL that created the BACPAC. Azure SQL is a bit funky here, so just run the latest SQL and SQL Management Studio and you should be fine.

此外,请确保您运行的是最新和/或匹配的SQL Server版本。它至少应该是创建BACPAC的SQL版本。 Azure SQL在这里有点时髦,所以只需运行最新的SQL和SQL Management Studio就可以了。

#1


2  

I never did figure this out, but uninstalling 2014 and dropping back to 2012 seemed to fix it. For now, I'm chalking it up to a bug in 2014. It's not even at the beta stage yet, so I suppose it's not surprising that there are still significant bugs. (Still, isn't it interesting how so many other companies manage to release software on a much more aggressive schedule than MS, with each release being so much more stable?)

我从来没有弄清楚这一点,但卸载2014年并回到2012年似乎解决了这个问题。现在,我正在粉碎它到2014年的一个错误。它还没有处于测试阶段,所以我认为仍然存在重大错误并不奇怪。 (仍然,有多少其他公司设法以比MS更激进的方式发布软件并不是很有趣,每个版本都更加稳定吗?)

#2


1  

I had same problem with SQL Server 2016RC2, export data from SQL Server 2014 and try to import on 2016RC2. For export and import I used SQL Management Studio 2014. That was the problem. When I installed SQL Management Studio 2016RC2 and use it for import the problem disappeared. In my case it was important to use same version of SQL Management Studio as the server on which the data is imported.

我遇到了与SQL Server 2016RC2相同的问题,从SQL Server 2014导出数据并尝试在2016RC2上导入。对于导出和导入,我使用了SQL Management Studio 2014.这就是问题所在。当我安装SQL Management Studio 2016RC2并将其用于导入时,问题就消失了。在我的情况下,使用相同版本的SQL Management Studio作为导入数据的服务器非常重要。

#3


0  

I had the same error, trying to import an export file from a V11 Azure db into a V12 localdb. Importing into the same version db (V11) worked. So my problem was mismatched versions.

我有同样的错误,尝试将导出文件从V11 Azure数据库导入到V12 localdb。导入到相同版本的db(V11)有效。所以我的问题是版本不匹配。

#4


0  

I updated my version of SQL Management Studio to v17.8.1 and restores started working with no errors. I've found BACPAC restores have worked best when I run the latest SSMS. If you're not running 17.x or higher, the "Check for updates" feature will NOT tell you 17.x is available, so don't rely on that feature :)

我将我的SQL Management Studio版本更新到v17.8.1并恢复开始工作没有错误。我发现当我运行最新的SSMS时,BACPAC恢复效果最好。如果你没有运行17.x或更高版本,“检查更新”功能将不会告诉你17.x可用,所以不要依赖于该功能:)

Here's a link to the download:

这是下载的链接:

https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-2017

Also, make sure you're running the latest and/or matching version of SQL Server. It should be at least the version of SQL that created the BACPAC. Azure SQL is a bit funky here, so just run the latest SQL and SQL Management Studio and you should be fine.

此外,请确保您运行的是最新和/或匹配的SQL Server版本。它至少应该是创建BACPAC的SQL版本。 Azure SQL在这里有点时髦,所以只需运行最新的SQL和SQL Management Studio就可以了。