首页 > 解决方案 > 如何在 Azure DevOps 服务器迁移到服务的步骤中识别初始目录(集合数据库的名称)?

问题描述

我是组织中 Azure DevOps Server 2019 Update 1.1 的管理员。我会将我们的集合从本地服务器迁移到 Azure DevOps Services。目前,我正在使用 SqlPackage.exe 生成 DACPAC 文件。 https://docs.microsoft.com/en-us/azure/devops/migrate/migration-import?view=azure-devops

根据this reference,生成DACPAC的命令示例如下。

SqlPackage.exe /sourceconnectionstring:"Data Source=localhost;Initial Catalog=Foo;Integrated Security=True" /targetFile:C:\DACPAC\Foo.dacpac /action:extract /p:ExtractAllTableData=true /p:IgnoreUserLoginMappings=true /p:IgnorePermissions=true /p:Storage=Memory

但是,我不明白什么是初始目录。参考资料说Initial Catalog - Name of the collection database. 但我在 Azure DevOps Server 管理控制台中找不到集合数据库的名称。

我在 dev.to 上引用了另一篇文章
https://dev.to/timothymcgrath/the-great-azure-devops-migration-part-6-import-2obc
在这篇文章中,Initial Catalog=[COLLECTION_NAME]我的 Azure DevOps 服务器中的集合名称是“DefaultCollection”(默认名称)。

然后,我尝试了以下命令然后失败了。

C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130> ./SqlPackage.exe /sourceconnectionstring:”Data Source=localhost;Initial Catalog=DefaultCollection;Integrated Security=True” /targetFile:C:\DefaultCollection.dacpac /action:extract /p:ExtractAllTableData=true /p:IgnoreUserLoginMappings=true /p:IgnorePermissions=true /p:Storage=Memory
Connecting to database 'DefaultCollection' on server 'localhost'.
Extracting schema
Extracting schema from database
*** Error extracting database:Could not connect to database server.

(provider: Named Pipes Provider, error: 40

这个错误是由错误的初始目录引起的吗?
如何找到正确的初始目录 - 集合数据库的名称?

环境和前提条件

标签: azure-devopsazure-devops-server-2019

解决方案


查看应用层上的管理控制台。这向您显示了所有数据库。

值得一提的是,默认集合数据库的标准名称是Tfs_DefaultCollection. 在您的情况下可能会有所不同,但这是一个安全的选择。


推荐阅读