Orchestrator
2023.4
False
横幅背景图像
Orchestrator 用户指南
上次更新日期 2024年4月19日

在存储提供程序之间移动存储桶数据

在某些情况下,可能有必要将存储桶数据从一个提供程序传输到另一个提供程序。

将存储桶数据从文件系统迁移到 Orchestrator 存储

以下过程介绍了以下场景:当前您依赖文件系统作为存储提供程序,想要转移到所配置存储类型为文件系统的 Orchestrator。为了方便起见,我们将文件系统称为 ,将 Orchestrator 称为目标

  1. 暂停所有使用源存储桶的流程。
  2. 在与源存储桶相同的文件夹中创建 Orchestrator 类型的新存储桶。
  3. 确定 Orchestrator 存储桶的基本路径。打开 Orchestrator 的 UiPath.Orchestrator.dll.config 文件,然后找到 Storage.TypeStorage.Location 键。如果 Storage.TypeFileSystem,则基本路径为 RootPath 前缀之后的部分。
  4. 通过运行以下 SQL 查询,确定目标存储桶的相对路径:
    declare @tenancyName nvarchar(64) = N'{tenant name}'
    declare @folderFullyQualifiedName nvarchar(1000) = N'{folder full path}'
    declare @destinationBucketName nvarchar(128) = N'{destination bucket name}'
    select '\)\)Orchestrator-' + LOWER(t.[Key]) + '\)\)BlobFilePersistence\)\)' +
        LOWER((select cast(b.[Identifier] as nvarchar(128))
            from dbo.Buckets b
            inner join dbo.OrganizationUnits ou
                on ou.Id = b.OrganizationUnitId
            where ou.TenantId = t.Id and ou.IsDeleted = 0 and ou.[FullyQualifiedName] = @folderFullyQualifiedName
                and b.TenantId = t.Id and b.IsDeleted = 0 and b.[Name] = @destinationBucketName))
    from dbo.Tenants t
    where t.TenancyName = @tenancyName and t.IsDeleted = 0declare @tenancyName nvarchar(64) = N'{tenant name}'
    declare @folderFullyQualifiedName nvarchar(1000) = N'{folder full path}'
    declare @destinationBucketName nvarchar(128) = N'{destination bucket name}'
    select '\)\)Orchestrator-' + LOWER(t.[Key]) + '\)\)BlobFilePersistence\)\)' +
        LOWER((select cast(b.[Identifier] as nvarchar(128))
            from dbo.Buckets b
            inner join dbo.OrganizationUnits ou
                on ou.Id = b.OrganizationUnitId
            where ou.TenantId = t.Id and ou.IsDeleted = 0 and ou.[FullyQualifiedName] = @folderFullyQualifiedName
                and b.TenantId = t.Id and b.IsDeleted = 0 and b.[Name] = @destinationBucketName))
    from dbo.Tenants t
    where t.TenancyName = @tenancyName and t.IsDeleted = 0
  5. 将所有文件和文件夹从源存储桶位置复制到目标存储桶位置。
    • 要复制文件和文件夹,您需要转到“存储桶”页面,找到源存储桶,选择“编辑”,然后单击“文件位置”
    • 目标存储桶位置格式如下:{基本路径} + {相对路径}(分别参见步骤 3步骤 4)。

      注意:如果相对路径的最后一段(应为文件夹)不存在,请在复制文件之前创建。复制操作完成后,请验证文件在 Orchestrator 的新存储桶下是否可见。
  6. 写下源存储桶名称并删除存储桶。
  7. 通过运行以下 SQL 查询,重命名目标存储桶:
    declare @tenantName nvarchar(64) = N'{tenant name}'
    declare @folderFullyQualifiedName nvarchar(1000) = N'{folder full path}'
    declare @destinationBucketName nvarchar(128) = N'{destination bucket name}'
    declare @originalBucketName nvarchar(128) = N'{source bucket name}'
    update b
    set b.[Name] = @originalBucketName
    from dbo.Buckets b
    inner join dbo.Tenants t
        on b.TenantId = t.Id
    inner join dbo.OrganizationUnits ou
        on b.OrganizationUnitId = ou.Id
    where b.TenantId = t.Id and b.IsDeleted = 0 and b.[Name] = @destinationBucketName
        and ou.TenantId = t.Id and ou.IsDeleted = 0 and ou.FullyQualifiedName = @folderFullyQualifiedNamedeclare @tenantName nvarchar(64) = N'{tenant name}'
    declare @folderFullyQualifiedName nvarchar(1000) = N'{folder full path}'
    declare @destinationBucketName nvarchar(128) = N'{destination bucket name}'
    declare @originalBucketName nvarchar(128) = N'{source bucket name}'
    update b
    set b.[Name] = @originalBucketName
    from dbo.Buckets b
    inner join dbo.Tenants t
        on b.TenantId = t.Id
    inner join dbo.OrganizationUnits ou
        on b.OrganizationUnitId = ou.Id
    where b.TenantId = t.Id and b.IsDeleted = 0 and b.[Name] = @destinationBucketName
        and ou.TenantId = t.Id and ou.IsDeleted = 0 and ou.FullyQualifiedName = @folderFullyQualifiedName
  8. 恢复在步骤 1 中暂停的流程。
    注意:文件系统允许您拥有根路径相同的两个存储桶。但如果 Orchestrator 是您的存储提供程序,则无法实现。在这种情况下,您需要重新编译工作流以在其活动中使用单个存储桶或多个文件夹路径。
  • 将存储桶数据从文件系统迁移到 Orchestrator 存储

此页面是否有帮助?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath 白色徽标
信任与安全
© 2005-2024 UiPath. All rights reserved.