azure-devops - 如何在 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
这个错误是由错误的初始目录引起的吗?
如何找到正确的初始目录 - 集合数据库的名称?
环境和前提条件
- 视窗 10 专业版
- 从 SSDT for Visual Studio 2017 安装的 SqlPackage.exe
- 执行命令的机器和运行 Azure DevOps Server 的机器相同
- 所以,
DataSource=localhost
应该是正确的,我认为
- 所以,
- 通过 Azure DevOps Server 管理控制台分离了我的集合
- 我的 Azure DevOps 服务器的 SQL Server Express 正在运行
解决方案
查看应用层上的管理控制台。这向您显示了所有数据库。
值得一提的是,默认集合数据库的标准名称是Tfs_DefaultCollection
. 在您的情况下可能会有所不同,但这是一个安全的选择。
推荐阅读
- javascript - 为什么innerHTML返回null
- javascript - documentGetElementById() 为空
- pandas - 我们可以在 pyspark 中使用 pandas 进行行操作吗?
- mysql - 添加更多列后结果发生变化
- powershell - 如何通过 Azure DevOps REST API 使用 PowerShell 创建功能以及链接任务?
- javascript - 如何从 ReactJS 中的嵌套组件访问父组件的方法
- xamarin - Xamarin 构建错误:定义默认接口方法需要 --min-sdk-version >= 24
- c++ - 并行 OpenMP 线程读取相同共享数据的竞争条件是否可能?
- javascript - 为什么我的 Firestore 文档包含在 MAP 对象中?
- android - “没有内容提供者:/storage/emulated/0/Pictures/Reddit/d8326aa.jpg”无缘无故抛出