匯出及匯入資源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.