Power BI Embedded 移轉工具Power BI Embedded migration tool

此移轉工具可以用來將報表從 Power BI Embedded Azure 服務 (PaaS) 複製至 Power BI 服務 (SaaS)。This migration tool can be used to copy your reports from the Power BI Embedded Azure service (PaaS) to the Power BI service (SaaS).

將內容從工作區集合移轉至 Power BI 服務時,可以同時移轉至目前解決方案,而且不需要任何關機時間。Migrating your content from your workspace collections to the Power BI service can be done in parallel to your current solution and doesn’t require any downtime.

限制Limitations

  • 已推送的資料集無法進行下載,並且需要使用 Power BI 服務的 Power BI REST API 進行重建。Pushed datasets cannot be downloaded and will need to be recreated using the Power BI REST APIs for the Power BI service.
  • 在 2016 年 11 月 26 日之前匯入的 PBIX 檔案將無法進行下載。PBIX files imported before November 26, 2016 will not be downloadable.

下載Download

您可以從 GitHub 下載移轉工具範例。You can download the migration tool sample from GitHub. 您可以下載存放庫的 ZIP,也可以在本機進行複製。You can either download a zip of the repository, or you can clone it locally. 下載之後,您可以在 Visual Studio 內開啟 powerbi-migration-sample.sln,來建置和執行移轉工具。Once downloaded, you can open powerbi-migration-sample.sln within Visual Studio to build and run the migration tool.

移轉計劃Migration Plans

您的移轉計劃只是將 Power BI Embedded 中的內容編成目錄的中繼資料,以及想要將它們發佈至 Power BI 服務的方式。Your migration plan is just metadata that catalogs the content within Power BI Embedded and how you want to publish them to the Power BI service.

從新的移轉計劃開始Start with a new migration plan

移轉計劃是 Power BI Embedded 中可用項目的中繼資料,接著會移至 Power BI 服務。A migration plan is the metadata of the items available in Power BI Embedded that you then want to move over to the Power BI service. 移轉計劃會儲存為 XML 檔案。The migration plan is stored as an XML file.

您會想要從建立新的移轉計劃開始。You will want to start by creating a new migration plan. 若要建立新的移轉計劃,請執行下列動作。To create a new migration plan, do the following.

  1. 選取 [檔案] > [New Migration Plan ](新增移轉計劃)。Select File > New Migration Plan.

  2. 在 [選取 Power BI Embedded 資源群組] 對話方塊中,您會想要選取 [環境] 下拉式清單,並選取 [生產環境]。In the Select Power BI Embedded Resource Group dialog, you will want to select the Environment dropdown and select prod.
  3. 系統將提示您登入。You will be prompted to sign in. 您將使用 Azure 訂用帳戶登入。You will use your Azure subscription login.

    重要

    這「不」是您用來登入 Power BI 的 Office 365 組織帳戶。This is not your Office 365 organization account that you sign into Power BI with.

  4. 選取 Azure 訂用帳戶,以儲存您的 Power BI Embedded 工作區集合。Select the Azure subscription which stores your Power BI Embedded workspace collections.

  5. 在訂用帳戶清單下方,選取包含您工作區集合的 [資源群組],然後選取 [選取]。Below the subscription list, select the Resource Group that contains your workspace collections and select Select.

  6. 選取 [分析]。Select Analyze. 這會取得 Azure 訂用帳戶內項目的清查,以讓您開始您的計劃。This will get an inventory of the items within your Azure subscription for you to begin your plan.

    注意

    根據工作區集合數目以及工作區集合中的內容量,分析程序可能需要幾分鐘的時間。The analyze process could take several minutes depending on the number of Workspace collections and how much content exists in the workspace collection.

  7. 分析會在完成時,提示您儲存移轉計劃。When Analyze is complete, it will prompt you to save your migration plan.

此時,您已將移轉計劃連接到 Azure 訂用帳戶。At this point, you have connected your migration plan to your Azure subscription. 請閱讀下列內容,了解如何使用移轉計劃的流程。Read below to understand the flow of how to work with your migration plan. 這包括 [Analyze & Plan Migration]\ (分析和規劃移轉)、[下載]、[建立群組] 和 [上傳]。This includes Analyze & Plan Migration, Download, Create Groups and Upload.

儲存移轉計劃Save your migration plan

您可以儲存移轉計劃,供日後使用。You can save your migration plan for use later. 這將會建立包含您移轉計劃中所有資訊的 XML 檔案。This will create an XML file that contained all the information in your migration plan.

若要儲存移轉計劃,請執行下列動作。To save your migration plan, do the following.

  1. 選取 [檔案] > [Save Migration Plan ] (儲存移轉計劃)。Select File > Save Migration Plan.

  2. 提供您檔案的名稱,或使用產生的檔案名稱,然後選取 [儲存]。Give your file a name or use the generated file name and select Save.

開啟現有移轉計劃Open an existing migration plan

您可以開啟已儲存的移轉計劃,繼續進行移轉。You can open a saved migration plan to continue working on your migration.

若要開啟現有移轉計劃,請執行下列動作。To open your existing migration plan, do the following.

  1. 選取 [檔案] > [Open Existing Migration Plan] (開啟現有移轉計劃)。Select File > Open Existing Migration Plan.

  2. 選取您的移轉檔案,然後選取 [開啟]。Select your migration file and select Open.

步驟 1:分析和規劃移轉Step 1: Analyze & Plan Migration

[Analyze & Plan Migration]\ (分析和規劃移轉) 索引標籤可讓您檢視 Azure 訂用帳戶資源群組中的目前內容。The Analyze & Plan Migration tab gives you a view of what is currently in your Azure subscription’s resource group.

分析與規劃移轉索引標籤

例如,我們將會查看 SampleResourceGroupWe will look at the SampleResourceGroup as an example.

PaaS 拓撲PaaS Topology

這會列出 [資源群組] > [工作區集合] > [工作區]。This is a listing of your Resource Group > Workspace collections > Workspaces. 資源群組和工作區集合將會顯示易記名稱。The resource group and workspace collections will show a friendly name. 工作區將會顯示 GUID。The workspaces will show a GUID.

清單中的項目也會以 (#/#) 格式顯示色彩和數字。The items in the list will also display a color and a number in the format of (#/#). 這指出可下載的報表數目。This indicates the number of reports that can be downloaded. 黑色表示可以下載所有報表。A black color means that all reports can be downloaded.

紅色表示無法下載一些報表。A red color means that some reports cannot be downloaded. 左邊的數字指出可下載的報表總數。The left number will indicate the total number of reports that can be downloaded. 右邊的數字指出群組內的報表總數。The number on the right indicates the total number of reports within the grouping.

您可以選取 PaaS 拓撲內的項目,以在 [報表] 區段中顯示報表。You can select an item within the PaaS topology to display the reports in the reports section.

報表Reports

[報表] 區段將會列出可用的報表,並指出是否可供下載。The reports section will list out the reports available and indicates whether it can be downloaded or not.

目標結構Target structure

您可以在目標結構中告訴工具項目的下載位置與其上傳方式。The Target structure is where you tell the tool where things will be downloaded to and how to upload them.

下載計劃Download Plan

會自動為您建立路徑。A path will automatically be created for you. 您可以視需要變更此路徑。You can change this path if you wish. 若您變更路徑,則需要選取 [更新路徑]。If you do change the path, you will need to select Update paths.

注意

這不會實際執行下載。This does not actually perform the download. 這只會指定報表下載目標位置的結構。This is only specifying the structure of where the reports will be downloaded to.

上傳計劃Upload Plan

您可以在這裡指定用於在 Power BI 服務內建立之應用程式工作區的前置詞。Here you can specify a prefix to be used for the App Workspaces that will be created within the Power BI service. 前置詞後面會是 Azure 中現有工作區的 GUID。After the prefix will be the GUID for the workspace that existed in Azure.

注意

這不會實際在 Power BI 服務內建立群組。This does not actually create the groups within the Power BI service. 這只會定義群組的命名結構。This only defines the naming structure for the groups.

如果您變更前置詞,則需要選取 [Generate Upload Plan] (產生上傳計劃)。If you change the prefix, you will need to select Generate Upload Plan.

您可以在群組上按一下滑鼠右鍵,然後選擇直接重新命名上傳計劃內的群組 (如有需要)。You can right click on a group and choose to rename the group within the Upload plan directly, if desired.

注意

「群組」的名稱不得包含空格或無效字元。The name of the group must not contain spaces or invalid characters.

步驟 2︰下載Step 2: Download

在 [下載] 索引標籤上,您會看到報表和相關聯中繼資料的清單。On the Download tab, you will see the list of reports and associated metadata. 您可以看到匯出狀態與先前匯出狀態。You can see what the export status is along with the previous export status.

您有兩個選項。You have two options.

  • 選取特定報表,然後選取 [Download Selected] (下載選取的項目)。Select specific reports and select Download Selected
  • 選取 [Download All] (全部下載)。Select Download All.

若是成功下載,您會看到 [完成] 狀態,而且它會反映 PBIX 檔案是否存在。For a successful download, you will see a status of Done and it will reflect that the PBIX file exists.

下載完成之後,請選取 [建立群組] 索引標籤。After the download is completed, select the Create Groups tab.

步驟 3:建立群組Step 3: Create Groups

在您下載可用的報表之後,可以移至 [建立群組] 索引標籤。此索引標籤將會根據您所建立的移轉計劃,在 Power BI 服務內建立應用程式工作區。After you have downloaded the reports that are available, you can go to the Create Groups tab. This tab will create the app workspaces within the Power BI service based on the migration plan that you created. 它將會使用您在 [Analyze & Plan Migration] (分析和規劃移轉) 的 [上傳] 索引標籤上提供的名稱,來建立應用程式工作區。It will create the app workspace with the name you provided on the Upload tab within Analyze & Plan Migration.

若要建立應用程式工作區,您可以選取 [Create Selected Groups ](建立選取的群組) 或 [Create All Missing Groups] (建立所有遺漏的群組)。To create the app workspaces, you can select either Create Selected Groups or Create All Missing Groups.

當您選取其中一個選項時,系統會提示您登入。When you select either of these options, you will be prompted to sign in. 您想要將認證用於您要在其上建立應用程式工作區的 Power BI 服務。You will want to use your credentials for the Power BI service that you want to create the app workspaces on.

這會在 Power BI 服務內建立應用程式工作區。This will create the app workspace within the Power BI service. 這不會將報表上傳至應用程式工作區。This does not upload the reports to the app workspace.

您可以登入 Power BI 並驗證工作區存在與否,確認已建立應用程式工作區。You can verify that the app workspace was created by signing into Power BI and validating that the workspace exists. 您會注意到工作區中沒有內容。You will notice that nothing is in the workspace.

建立工作區之後,您可以移至 [上傳] 索引標籤。After the workspace is created, you can move onto the Upload tab.

步驟 4:上傳Step 4: Upload

在 [上傳] 索引標籤上,這會將報表上傳至 Power BI 服務。On the Upload tab, this will upload the reports to the Power BI service. 您會在 [下載] 索引標籤上看到我們已下載的報表清單,以及根據您移轉計劃的目標群組名稱。You will see a list of the reports that we downloaded on the Download tab along with the target group name based on your migration plan.

您可以上傳選取的報表,或上傳所有報表。You can upload selected reports, or you could upload all the reports. 您也可以重設上傳狀態來重新上傳項目。You can also reset the upload status to re-upload items.

您也可以選擇選取在有同名的報表時要怎麼處理。You also have the option of selecting what to do if a report with the same name exists. 您可以選擇 [中止]、[忽略] 和 [覆寫]。You can choose between Abort, Ignore and Overwrite.

重複的報表名稱Duplicate report names

如果您有同名的報表,但知道它是不同的報表,則需要變更報表的 TargetNameIf you have a report that has the same name, but you know it is a different report, you will need to change the TargetName of the report. 您可以手動編輯移轉計劃 XML 來變更名稱。You can change the name by manually editing the migration plan XML.

您需要關閉移轉工具才能進行變更,然後重新開啟此工具和移轉計劃。You will need to close the migration tool to make the change and then re-open the tool and the migration plan.

在上述範例中,其中一個複製的報表失敗,並指出已有同名的報表。In the above example, one of the cloned reports failed indicating a report with the same name existed. 如果我們查看移轉計劃 XML,則會看到下列情況。If we go look at the migration plan XML, we will see the following.

<ReportMigrationData>
    <PaaSWorkspaceCollectionName>SampleWorkspaceCollection</PaaSWorkspaceCollectionName>
    <PaaSWorkspaceId>4c04147b-d8fc-478b-8dcb-bcf687149823</PaaSWorkspaceId>
    <PaaSReportId>525a8328-b8cc-4f0d-b2cb-c3a9b4ba2efe</PaaSReportId>
    <PaaSReportLastImportTime>1/3/2017 2:10:19 PM</PaaSReportLastImportTime>
    <PaaSReportName>cloned</PaaSReportName>
    <IsPushDataset>false</IsPushDataset>
    <IsBoundToOldDataset>false</IsBoundToOldDataset>
    <PbixPath>C:\MigrationData\SampleResourceGroup\SampleWorkspaceCollection\4c04147b-d8fc-478b-8dcb-bcf687149823\cloned-525a8328-b8cc-4f0d-b2cb-c3a9b4ba2efe.pbix</PbixPath>
    <ExportState>Done</ExportState>
    <LastExportStatus>OK</LastExportStatus>
    <SaaSTargetGroupName>SampleMigrate</SaaSTargetGroupName>
    <SaaSTargetGroupId>6da6f072-0135-4e6c-bc92-0886d8aeb79d</SaaSTargetGroupId>
    <SaaSTargetReportName>cloned</SaaSTargetReportName>
    <SaaSImportState>Failed</SaaSImportState>
    <SaaSImportError>Report with the same name already exists</SaaSImportError>
</ReportMigrationData>

針對失敗的項目,我們可以變更 SaaSTargetReportName 的名稱。For the failed item, we can change the name of the SaaSTargetReportName.

<SaaSTargetReportName>cloned2</SaaSTargetReportName>

我們接著可以在移轉工具中重新開啟計劃,並上傳失敗的報表。We can then re-open the plan, in the migration tool, and upload the failed report.

回到 Power BI,即可在應用程式工作區中看到已上傳報表和資料集。Going back to Power BI, we can see that the reports and datasets have been uploaded in the app workspace.

上傳本機 PBIX 檔案Upload a local PBIX file

您可以上傳 Power BI Desktop 檔案的本機版本。You can upload a local version of a Power BI Desktop file. 您需要關閉工具,並編輯 XML,然後將本機 PBIX 的完整路徑放到 PbixPath 屬性中。You will have to close the tool, edit the XML and put the full path to your local PBIX in the PbixPath property.

<PbixPath>[Full Path to PBIX file]</PbixPath>

在您編輯 XML 之後,請在移轉工具內重新開啟計劃,並上傳報表。After you have edited the xml, re-open the plan within the migration tool and upload the report.

DirectQuery 報表DirectQuery reports

您需要更新 DirectQuery 報表的連接字串。You will need to update to update the connection string for DirectQuery reports. 這可以在 powerbi.com 內完成,也可以透過程式設計方式從 Power BI Embedded (Paas) 查詢連接字串。This can be done within powerbi.com, or you can programmatically query the connection string from Power BI Embedded (Paas). 如需範例,請參閱從 PaaS 報表擷取 DirectQuery 連接字串For an example, see Extract DirectQuery connection string from PaaS report.

您接著可以更新 Power BI 服務 (Saas) 內資料集的連接字串,並設定資料來源的認證。You can then update the connection string for the dataset within the Power BI service (Saas) and set the credentials for the data source. 您可以查看下列範例,以了解做法。You can look at the following examples to see how to do this.

內嵌Embedding

既然,您的報表已從 Power BI Embedded Azure 服務升級為 Power BI 服務,您現在可以更新您的應用程式,並開始將報表內嵌在此應用程式工作區中。Now that your reports have been migrated from the Power BI Embedded Azure service to the Power BI service, you can now update your application and begin embedding the reports in this app workspace.

如需詳細資訊,請參閱如何將 Power BI Embedded 工作區集合內容移轉至 Power BIFor more information, see How to migrate Power BI Embedded workspace collection content to Power BI.

後續步驟Next steps

內嵌在 Power BI 之中Embedding with Power BI
如何將 Power BI Embedded 工作區集合內容移轉至 Power BIHow to migrate Power BI Embedded workspace collection content to Power BI
何謂 Power BI PremiumPower BI Premium - what is it?
JavaScript API Git 存放庫JavaScript API Git repo
Power BI C# Git 存放庫Power BI C# Git repo
JavaScript 內嵌示範JavaScript embed sample
Power BI Premium 技術白皮書Power BI Premium whitepaper

有其他問題嗎?More questions? 嘗試在 Power BI 社群提問Try asking the Power BI Community