UiPath Documentation
ai-center
2022.4
false
AI Center 用户指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

迁移到独立环境或 Automation Suite 环境

备注:

无法从2020.10或2021.4经典升级到AI Center 2022.4 ,而是需要安装 AI Center 独立版 2022.4 或作为新的 Automation Suite 安装的一部分,并且您可以从以前的环境迁移工作。 此迁移脚本适用于两种类型的安装,即 AI Center 独立版或 Automation Suite 环境。

To upgrade from AI Center 2021.10, follow the procedures from the Upgrading AI Center page.

概述​

使用此过程从 2021.4 或 2020.10 迁移到 2022.4。为此,需要全新安装和迁移,而不是升级。

使用以下步骤将 AI Center 租户数据迁移到 AI Center 独立环境或 Automation Suite 环境。此过程为以下项目提供迁移支持:

  • 数据库

  • 数据集

  • ML 包

    备注:

    在部署和训练迁移的 DU ML 包之前,必须执行 Document Understanding 按需捆绑包。

    In case of airgapped installation, make sure that the models with the same major version are added to your out of the box models. For more information on installing models offline, see ML Packages Offline Installation.

先决条件​

确保 AI Center 在这两种环境中均已启动并正在运行。

此外,运行迁移脚本的计算机必须满足以下先决条件:

  • 安装了以下依赖项的 Linux 计算机:aws s3、s3cmd、jq、zip。该计算机可以是其中一台 AI Center 计算机,也可以是新计算机。有关详细信息,请参阅下面的示例。

安装 aws s3、s3cmd、jq、zip 依赖项

备注:

In case of unmet dependencies, run the following commands with no packages:

sudo susudo apt install -y jq awscli s3cmd zip gitsudo apt --fix-broken installsudo apt install -y jq awscli s3cmd zip
sudo susudo apt install -y jq awscli s3cmd zip gitsudo apt --fix-broken installsudo apt install -y jq awscli s3cmd zip
  • 从此处安装 MS SQL 实用程序。您可以通过运行以下命令来执行此操作:

    sudo su
    curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.listsudo apt-get update
    sudo apt-get install mssql-tools unixodbc-devsudo apt-get update
    sudo apt-get install mssql-toolsecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profileecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
    source ~/.bashrc
    sudo su
    curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.listsudo apt-get update
    sudo apt-get install mssql-tools unixodbc-devsudo apt-get update
    sudo apt-get install mssql-toolsecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profileecho 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
    source ~/.bashrc
    
  • 与两个 AI Center 实例的连接。

  • 与两个 Orchestrator 实例的连接(以防实例不同)。

  • 与 SQL Server 的连接(以防实例不同)。

  • 可以访问两个 AI Center 实例。

程序​

步骤 1:在 Automation Suite 或新的 AI Center 环境中创建同名租户​

在 Automation Suite 或新的 AI Center 环境中为要迁移的每个租户创建相应的租户。

步骤 2:在第一台计算机(也称为源计算机)上生成 Storage-creds.json 文件​

此步骤需要在第一台计算机上运行,即您要迁移到新环境的计算机。

  1. 使用 SSH 连接到要迁移的计算机。

  2. 通过执行以下命令生成 storage-creds.json 文件:

    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/stable/platform/sfmigration/storagemigration/get-credentials.sh
    chmod 777 get-credentials.sh
    ./get-credentials.sh
    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/stable/platform/sfmigration/storagemigration/get-credentials.sh
    chmod 777 get-credentials.sh
    ./get-credentials.sh
    
备注:

If running from a third machine make sure to run the following command :

./get-credentials.sh {PUBLIC_IP_REPLICATED_MACHINE}
./get-credentials.sh {PUBLIC_IP_REPLICATED_MACHINE}
备注:

If the error message from below is displayed after running the above script, run the bash -l command and try running the above script again

在步骤 2 中生成的文件 (storage-creds.json) 将用于后续步骤。确保在本地复制并保存文件的内容。

步骤 3:在第二台计算机上生成 Storage-creds.json 文件​

此步骤需要在第二台计算机上运行,即在 Automation Suite 环境中运行的计算机。

  1. 在 Automation Suite 计算机上打开端口 22。

  2. 使用 SSH 连接到 Automation Suite 计算机。

  3. 运行以下命令:

    sudo su
    export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin
    sudo su
    export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/var/lib/rancher/rke2/bin
    
  4. 通过执行以下命令下载凭据文件:

    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/stable/platform/sfmigration/storagemigration/get-credentials-sf.sh
    chmod 777 get-credentials-sf.sh
    ./get-credentials-sf.sh
    wget https://raw.githubusercontent.com/UiPath/ai-customer-scripts/stable/platform/sfmigration/storagemigration/get-credentials-sf.sh
    chmod 777 get-credentials-sf.sh
    ./get-credentials-sf.sh
    

在步骤 4 中生成的文件 (storage-creds-sf.json) 将用于后续步骤。确保在本地复制并保存文件的内容。

步骤 4:配置执行脚本的计算机​

在完成以下步骤之前,请在 Automation Suite 环境中手动创建一个具有相同名称的租户。无论必须迁移哪个租户,都必须在 Automation Suite 中创建相应的租户。

此步骤需要在执行脚本的计算机上运行。

  1. 运行以下命令以下载迁移脚本(这将从公共 git 存储库下载脚本):

    sudo su
    cd ~
    mkdir migration
    cd migration
    git clone https://github.com/UiPath/ai-customer-scripts
    cd ai-customer-scripts
    git checkout stable
    cd platform
    chmod 777 -R sfmigration
    cd ~/migration/ai-customer-scripts/platform/sfmigration/storagemigration/
    sudo su
    cd ~
    mkdir migration
    cd migration
    git clone https://github.com/UiPath/ai-customer-scripts
    cd ai-customer-scripts
    git checkout stable
    cd platform
    chmod 777 -R sfmigration
    cd ~/migration/ai-customer-scripts/platform/sfmigration/storagemigration/
    
  2. 将 SOURCE_CREDENTIAL_FILE 文件中的内容替换为 storage-creds.json 中的内容(请参阅步骤 2)。

  3. 将 TARGET_CREDENTIAL_FILE 文件中的内容替换为 storage-creds-sf.json 中的内容(请参阅步骤 3)。

  4. 通过运行以下命令转到基本目录:

    cd ~/migration/ai-customer-scripts/platform/sfmigration/
    cd ~/migration/ai-customer-scripts/platform/sfmigration/
    

替换 input.json 文件中的详细信息(目录中已存在的文件)。为便于参考,凭据在 input.json 文件中标记为 TO-BE-REPLACED。

下面提到了带有每个字段说明的示例 JSON 文件。

{
"SRC_AIC_INSTALLATION_VERSION": "TO-BE-REPLACED", // Values can be : 20.10 OR 21.4
"SRC_SERVER": "TO-BE-REPLACED",   // Replicated SQL Server host
"SRC_PKGMANAGER_DB_NAME": "TO-BE-REPLACED", // Replicated SQL Server Pkgmanager DB name
"SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager", // Replicated SQL Server Pkgmanager DB schema, Note : Please check schema in case of multiple dbs in replicated
"SRC_PKGMANAGER_DB_USERNAME": "TO-BE-REPLACED", // Replicated SQL Server Pkgmanager DB Username
"SRC_PKGMANAGER_DB_PASSWORD": "TO-BE-REPLACED",  // Replicated SQL Server Pkgmanager DB Password
"SRC_TRAINER_DB_NAME": "TO-BE-REPLACED", // Replicated SQL Server AI-Trainer DB Name
"SRC_TRAINER_DB_SCHEMA": "ai_trainer", // Replicated SQL Server AI-Trainer DB Schema, Note : Please check schema in case of multiple dbs in replicated
"SRC_TRAINER_DB_USERNAME": "TO-BE-REPLACED", // Replicated SQL Server AI-Trainer DB Username
"SRC_TRAINER_DB_PASSWORD": "TO-BE-REPLACED",// Replicated SQL Server AI-Trainer DB Password
"DESTINATION_SERVER": "TO-BE-REPLACED", // Destination SQL Server host i.e ServiceFabric SQL Server host
"DESTINATION_DB_NAME": "TO-BE-REPLACED", // Destination SQL Server DB Name
"DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
"DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
"DESTINATION_DB_USERNAME": "TO-BE-REPLACED", // Destination SQL Server Username
"DESTINATION_DB_PASSWORD": "TO-BE-REPLACED", // Destination SQL Server Password
"TENANT_MAP": [
{
"SRC_TENANT_ID": "TO-BE-REPLACED", // Source Tenant Id i.e tenant UUID in replicated environment
"DESTINATION_TENANT_ID": "TO-BE-REPLACED", // Destination Tenant Id i.e Tenant UUID in the destination environment
"DESTINATION_ACCOUNT_ID": "TO-BE-REPLACED" // Destination Account UUID Id , host if Migrating to ServiceFabric standalone environment otherwise provide the actual Account UUID
}
]
{
"SRC_AIC_INSTALLATION_VERSION": "TO-BE-REPLACED", // Values can be : 20.10 OR 21.4
"SRC_SERVER": "TO-BE-REPLACED",   // Replicated SQL Server host
"SRC_PKGMANAGER_DB_NAME": "TO-BE-REPLACED", // Replicated SQL Server Pkgmanager DB name
"SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager", // Replicated SQL Server Pkgmanager DB schema, Note : Please check schema in case of multiple dbs in replicated
"SRC_PKGMANAGER_DB_USERNAME": "TO-BE-REPLACED", // Replicated SQL Server Pkgmanager DB Username
"SRC_PKGMANAGER_DB_PASSWORD": "TO-BE-REPLACED",  // Replicated SQL Server Pkgmanager DB Password
"SRC_TRAINER_DB_NAME": "TO-BE-REPLACED", // Replicated SQL Server AI-Trainer DB Name
"SRC_TRAINER_DB_SCHEMA": "ai_trainer", // Replicated SQL Server AI-Trainer DB Schema, Note : Please check schema in case of multiple dbs in replicated
"SRC_TRAINER_DB_USERNAME": "TO-BE-REPLACED", // Replicated SQL Server AI-Trainer DB Username
"SRC_TRAINER_DB_PASSWORD": "TO-BE-REPLACED",// Replicated SQL Server AI-Trainer DB Password
"DESTINATION_SERVER": "TO-BE-REPLACED", // Destination SQL Server host i.e ServiceFabric SQL Server host
"DESTINATION_DB_NAME": "TO-BE-REPLACED", // Destination SQL Server DB Name
"DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
"DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
"DESTINATION_DB_USERNAME": "TO-BE-REPLACED", // Destination SQL Server Username
"DESTINATION_DB_PASSWORD": "TO-BE-REPLACED", // Destination SQL Server Password
"TENANT_MAP": [
{
"SRC_TENANT_ID": "TO-BE-REPLACED", // Source Tenant Id i.e tenant UUID in replicated environment
"DESTINATION_TENANT_ID": "TO-BE-REPLACED", // Destination Tenant Id i.e Tenant UUID in the destination environment
"DESTINATION_ACCOUNT_ID": "TO-BE-REPLACED" // Destination Account UUID Id , host if Migrating to ServiceFabric standalone environment otherwise provide the actual Account UUID
}
]

包含已填充的示例值的示例 input.json 文件供您参考(请注意,以下屏幕截图是从单一来源数据库迁移到单一目标数据库的屏幕截图)

{
        "SRC_AIC_INSTALLATION_VERSION": "20.10",
        "SRC_SERVER": "sankar-sf-migration1sqlserver.database.windows.net",
        "SRC_PKGMANAGER_DB_NAME": "aifabric",
        "SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "SRC_PKGMANAGER_DB_USERNAME": "test",
        "SRC_PKGMANAGER_DB_PASSWORD": "test",
        "SRC_TRAINER_DB_NAME": "aifabric",
        "SRC_TRAINER_DB_SCHEMA": "ai_trainer",
        "SRC_TRAINER_DB_USERNAME": "test",
        "SRC_TRAINER_DB_PASSWORD": "test",
        "DESTINATION_SERVER": "sfdev2290542-9a5254d2-sql.database.windows.net",
        "DESTINATION_DB_NAME": "AutomationSuite_AICenter",
        "DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
        "DESTINATION_DB_USERNAME": "test",
        "DESTINATION_DB_PASSWORD": "test",
        "TENANT_MAP": [
                {
                        "SRC_TENANT_ID": "d1eb428c-e188-46bf-a1dd-8908f90b4084",
                        "DESTINATION_TENANT_ID": "03527165-b242-4b98-834f-2eb3e5957223",
                        "DESTINATION_ACCOUNT_ID": "8cd64e27-12f4-427c-a575-dd4f2ea82551"
                }
        ]
}
{
        "SRC_AIC_INSTALLATION_VERSION": "20.10",
        "SRC_SERVER": "sankar-sf-migration1sqlserver.database.windows.net",
        "SRC_PKGMANAGER_DB_NAME": "aifabric",
        "SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "SRC_PKGMANAGER_DB_USERNAME": "test",
        "SRC_PKGMANAGER_DB_PASSWORD": "test",
        "SRC_TRAINER_DB_NAME": "aifabric",
        "SRC_TRAINER_DB_SCHEMA": "ai_trainer",
        "SRC_TRAINER_DB_USERNAME": "test",
        "SRC_TRAINER_DB_PASSWORD": "test",
        "DESTINATION_SERVER": "sfdev2290542-9a5254d2-sql.database.windows.net",
        "DESTINATION_DB_NAME": "AutomationSuite_AICenter",
        "DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
        "DESTINATION_DB_USERNAME": "test",
        "DESTINATION_DB_PASSWORD": "test",
        "TENANT_MAP": [
                {
                        "SRC_TENANT_ID": "d1eb428c-e188-46bf-a1dd-8908f90b4084",
                        "DESTINATION_TENANT_ID": "03527165-b242-4b98-834f-2eb3e5957223",
                        "DESTINATION_ACCOUNT_ID": "8cd64e27-12f4-427c-a575-dd4f2ea82551"
                }
        ]
}

包含已填充示例值的示例 input.json 文件供您参考(请注意,以下屏幕截图是从多源数据库迁移到单目标数据库的屏幕截图)

{
        "SRC_AIC_INSTALLATION_VERSION": "20.10",
        "SRC_SERVER": "sankar-sf-migration1sqlserver.database.windows.net",
        "SRC_PKGMANAGER_DB_NAME": "aifabric_pkgmanager",
        "SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "SRC_PKGMANAGER_DB_USERNAME": "test_1",
        "SRC_PKGMANAGER_DB_PASSWORD": "test_1",
        "SRC_TRAINER_DB_NAME": "aifabric_trainer",
        "SRC_TRAINER_DB_SCHEMA": "ai_trainer",
        "SRC_TRAINER_DB_USERNAME": "test_2",
        "SRC_TRAINER_DB_PASSWORD": "test_2",
        "DESTINATION_SERVER": "sfdev2290542-9a5254d2-sql.database.windows.net",
        "DESTINATION_DB_NAME": "AutomationSuite_AICenter",
        "DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
        "DESTINATION_DB_USERNAME": "test",
        "DESTINATION_DB_PASSWORD": "test",
        "TENANT_MAP": [
                {
                        "SRC_TENANT_ID": "d1eb428c-e188-46bf-a1dd-8908f90b4084",
                        "DESTINATION_TENANT_ID": "03527165-b242-4b98-834f-2eb3e5957223",
                        "DESTINATION_ACCOUNT_ID": "8cd64e27-12f4-427c-a575-dd4f2ea82551"
                }
        ]
}
{
        "SRC_AIC_INSTALLATION_VERSION": "20.10",
        "SRC_SERVER": "sankar-sf-migration1sqlserver.database.windows.net",
        "SRC_PKGMANAGER_DB_NAME": "aifabric_pkgmanager",
        "SRC_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "SRC_PKGMANAGER_DB_USERNAME": "test_1",
        "SRC_PKGMANAGER_DB_PASSWORD": "test_1",
        "SRC_TRAINER_DB_NAME": "aifabric_trainer",
        "SRC_TRAINER_DB_SCHEMA": "ai_trainer",
        "SRC_TRAINER_DB_USERNAME": "test_2",
        "SRC_TRAINER_DB_PASSWORD": "test_2",
        "DESTINATION_SERVER": "sfdev2290542-9a5254d2-sql.database.windows.net",
        "DESTINATION_DB_NAME": "AutomationSuite_AICenter",
        "DESTINATION_PKGMANAGER_DB_SCHEMA": "ai_pkgmanager",
        "DESTINATION_TRAINER_DB_SCHEMA": "ai_trainer",
        "DESTINATION_DB_USERNAME": "test",
        "DESTINATION_DB_PASSWORD": "test",
        "TENANT_MAP": [
                {
                        "SRC_TENANT_ID": "d1eb428c-e188-46bf-a1dd-8908f90b4084",
                        "DESTINATION_TENANT_ID": "03527165-b242-4b98-834f-2eb3e5957223",
                        "DESTINATION_ACCOUNT_ID": "8cd64e27-12f4-427c-a575-dd4f2ea82551"
                }
        ]
}

可以通过以下步骤获取 SRC_TENANT_ID:

  1. 单击 AI Center 应用程序主页上的 UiPath 徽标。

  2. 右键单击浏览器并转到“检查”。打开“检查”窗口后,检查项目 API 调用的“网络”选项卡。租户 ID 可以在“预览”部分中看到,如下面的屏幕截图所示。

  3. 在执行脚本的计算机中添加 Automation Suite 计算机的对象存储的 DNS。这可以在创建 Automation Suite 环境的管道的扩展程序选项卡中找到。

    sudo bash -c "echo "LB_IP objectstore.DNS_NAME" >> /etc/hosts"
    sudo bash -c "echo "LB_IP objectstore.DNS_NAME" >> /etc/hosts"
    

Step 5: Run the migration script​

转到使用情况目录中下载 sfmigration 的文件夹:运行以下命令:

cd ~/migration/ai-customer-scripts/platform/sfmigration/

 ./mastermigrationscript.sh input.json
cd ~/migration/ai-customer-scripts/platform/sfmigration/

 ./mastermigrationscript.sh input.json

故障排除​

创建租户​

在运行迁移脚本之前,需要在 Automation Suite 环境中创建租户。

重新运行迁移​

迁移脚本仅用于迁移数据集和 ML 包一次。在极少数情况下,迁移完成后在来源环境中添加了一些额外的数据集或 ML 包,那么在这种情况下,需要重新运行迁移。在重新运行迁移之前,在目标数据库中运行以下命令:

delete from [ai_pkgmanager].[ml_package_versions_temp];
delete from [ai_pkgmanager].[projects] where tenant_id in ('T1','T2',...);
delete from [ai_pkgmanager].[ml_packages] where tenant_id in ('T1','T2',...);
delete from [ai_pkgmanager].[ml_package_versions] where tenant_id in ('T1','T2',...);
delete from [ai_trainer].[datasets] where tenant_id in ('T1','T2',...);
delete from [ai_pkgmanager].[ml_package_versions_temp];
delete from [ai_pkgmanager].[projects] where tenant_id in ('T1','T2',...);
delete from [ai_pkgmanager].[ml_packages] where tenant_id in ('T1','T2',...);
delete from [ai_pkgmanager].[ml_package_versions] where tenant_id in ('T1','T2',...);
delete from [ai_trainer].[datasets] where tenant_id in ('T1','T2',...);

注意:上面查询中的 'T1'、'T2'、... 是目标环境中的租户 UUID。这些是运行迁移脚本 ./mastermigrationscript.sh input.json 时传递的 input.json 文件中提到的 DESTINATION_TENANT_ID

然后,您可以使用以下命令重新运行迁移:

cd ~/migration/ai-customer-scripts/platform/sfmigration/

./mastermigrationscript.sh input.json
cd ~/migration/ai-customer-scripts/platform/sfmigration/

./mastermigrationscript.sh input.json

克隆的包​

迁移后,来源环境中的克隆 ML 包将在 Automation Suite 环境中标记为 VALIDATION_FAILED。迁移完成后,需要在目标环境中再次克隆这些包。

备注:

In this case, cloned packages refers to the packages from UiPath and Open-Source Packages.

此页面有帮助吗?

连接

需要帮助? 支持(opens in new window)

想要了解详细内容? UiPath Academy(opens in new window)

有问题? UiPath 论坛(opens in new window)

保持更新