导出和导入资源Export and import resources

如果创建了多个环境来支持数据库和应用的开发,则必须将所做更改从一个环境移至另一个环境。If you've created multiple environments to support the development of your database and apps, you must move changes from one environment to another environment. 可使用“导出资源”和“导入资源”在环境之间移动资源。You can use Export resources and Import resources to move resources between environments.

为何使用多个环境?Why use multiple environments?

每个环境都包含在开发过程中创建或修改的资源,例如实体、流和应用。Each environment contains resources, such as entities, flows, and apps, that you create or modify during the development process.

通常,可在组织的最终用户使用的同一个环境中完成开发。Typically, development is done in the same environment that is used by the organization's end users. 此环境称为默认环境。This environment is known as the default environment. 在同一环境中管理资源更改相对较容易。It's relatively easy to manage resource changes in the same environment. 验证更改以确保所有关键业务流程和应用程序正常运行后,即可发布该应用。You validate the changes to make sure that all critical business processes and applications are functional, and then you release the app.

有时,需在单独的环境中执行开发和测试,当所做更改可供最终用户使用时,会将其移动到默认环境。Sometimes, development and testing are done in separate environments, and changes are moved to the default environment when they are ready to be used by end users. 有这么几个可能需使用单独环境的原因。There are several reasons why you might use separate environments. 例如,最初评估系统时可能已使用了单独的环境。For example, you might have used a separate environment when you initially evaluated the system. 或者,可能希望最大限度降低对默认环境进行更改时所存在的风险。Alternatively, you might want to minimize the risk that is involved when changes are made to the default environment. 单独的环境提供隔离,因为不是在默认环境中进行更改。Separate environments provide isolation, because you make your changes in an environment that isn't the default environment. 根据风险程度,可能还要创建一个过渡环境。Depending on the extent of the risks, you might create an additional staging environment. 在这种情况下,便有一个开发环境、一个过渡环境和一个默认环境。In this case, you have a development environment, a staging environment, and a default environment.

移动资源更改Moving resource changes

可使用包 (.zip) 文件通过单独的导出和导入过程来移动资源。You move resources through separate export and import processes, by using a package (.zip) file. 将包文件导出、保存到本地存储,发送给目标环境的管理员,然后导入到目标环境。The package file is exported, saved to local storage, sent to the administrator of the target environment, and then imported into the target environment. 通常先进行验证测试以帮助确保未对关键业务流程产生负面影响,之后再开始导入过程。The import process is often followed by validation testing to help guarantee that no critical business processes have been adversely affected.

管理中心的环境部分同时提供了资源导入和资源导出的功能。The functionality for both resource import and resource export is available in the Environments section of the admin center. 导出和导入过程均在所选环境的上下文中发生。Both export and import occur in the context of a selected environment.

导出资源Export resources

导出包包含对实体和选择列表进行的所有更改。The export package will contain all changes to entities, and picklists. 我们正在努力实现更多资源类型的导出,例如应用、流、连接器和角色等类型。We are working to enable the export of more resource types such as apps, flows, connectors, roles and others. 使用此选项,可将某一环境中的内容移动到另一环境。This option lets you move contents of one environment to another environment.

  1. 管理中心的左侧导航窗格中,单击“环境”。In the admin center, in the left navigation pane, click Environments.
  2. 选择源环境。Select the source environment.
  3. 在右上角,单击“导出资源”。In the upper right, click Export resources.
  4. 选择要开始导出的资源:Choose the resources you want to start with:
    1. 选择对应要选择的资源类型的选项卡,例如“实体”。Select the tab corresponding to a resource type you want to select, such as Entities.
    2. 单击标头复选框或分别选中各个资源,选择此类型下的所有资源。Select all resources under the type by clicking the header checkbox, or select resources individually.
    3. 单击“下一步”。Click Next.
  5. 必要时将相关资源包含在内:Include related resources if appropriate:
    1. 如果发现了任何相关资源,则会显示一个预选择列表。If we discover any related resources, we will show you a pre-selected list.
    2. 单击标头复选框或分别取消选中各个资源,排除所有相关资源。Exclude all related resources by clicking the header checkbox, or unselect resources individually.
    3. 单击“下一步”。Click Next.
  6. 为导出的包添加“名称”。Add a Name for the exported package.
  7. 或者,可以自定义在导入资源后要执行的安装操作:Optionally, you can customize setup actions to be performed upon import of resources:
    1. 对于每个资源,单击“导入安装程序”,看到一个对话框。For each resource, click the Import setup to see a dialog.
    2. 选择在导入此包后要默认执行的安装操作Select the setup action you want performed by default when this package is imported
    3. 单击“保存”。Click Save.
  8. 单击“导出”。Click Export.
  9. 导出完成后,将包文件保存到本地存储。When export is completed, save the package file in local storage.

或者,可以单击资源选择页上的“选择所有资源”,以便在最终的包中包含所有支持类型的所有资源,然后直接转到最后的导出页。Alternatively, you can click Select all resources in the resource selection page to include all resources of all supported types in the final package, and go directly to the final export page.

导入资源Import resources

首先,选择从源环境导出的包文件。The first step is to select a package file that was exported from the source environment. 导入过程会验证、分析并尝试导入该包。The import process validates, analyzes, and tries to import the package.

  1. 管理中心的导航窗格中,单击“环境”。In the admin center, in the navigation pane, click Environments.
  2. 选择目标环境。Select the target environment.
  3. 在右上角,单击“导入资源”。In the upper right, click Import resources.
  4. 单击“上传”,然后浏览到本地存储中的包文件。Click Upload, and browse to a package file in local storage.
  5. 单击“下一步”转到最后的导入页。Click Next to go to the final import page.
  6. 解决导入验证错误和警告:Resolve import validation errors and warnings:
    1. 按照资源名称左侧的图标所示,查找警告或错误。Look for warnings or errors, as indicated by the icon to the left of a resource Name.
    2. 单击“操作”下的“导入安装程序”字段或图标了解详细信息。Click the Import setup field or the icon under Action for more information.
    3. 选择相应的导入安装操作。Select an appropriate import setup action.
    4. 将自动重新验证正在导入的包。The package being imported is automatically validated again.
  7. 如果没有错误,则继续执行“导入”。Proceed to Import if there are no errors.

如果仅应用了部分包,则会收到一条指明已导入和未导入内容的错误消息。If the package is only partially applied, you receive an error message that describes what was imported and what wasn't imported.

资源类型Resource types

开发过程可能涉及对许多类型资源的更改。The development process can involve changes to many types of resources. 例如,如果要更新应用,可能需添加、删除或更新多个实体或连接。For example, if you update an app, you might add, remove, or update several entities or connections. 可跨环境移动对某些(并非全部)资源类型所做的更改。Changes to some, and not all, resource types can be moved across environments. 以下各部分介绍了可移动的资源类型。The following sections describe the types of resources that you can move.

实体,选择列表Entities, picklists

可导出和导入如下实体和选择列表:You can export and import entities, and picklists as follows:

  • 标准实体 - 仅跨环境移动自定义项。Standard entities – Only customizations are moved across environments. (不能修改标准实体的现成字段。)(You can't modify the out-of-box fields of standard entities.)
  • 自定义实体 - 跨环境移动自定义实体。Custom entities – Custom entities are moved across environments.
  • 自定义选择列表 - 跨环境移动自定义选择列表。Custom picklists – Custom picklists are moved across environments.


导出和导入资源时不能移动数据库数据。You can't move database data as part of the export and import of resources. 若要移动数据,可使用 Microsoft Excel。To move data, you can use Microsoft Excel. 有关详细信息,请参阅导入或导出数据For more information, see Import or export data.