Migrate portal configuration

Note

Effective October 12, 2022, Power Apps portals is Power Pages. More information: Microsoft Power Pages is now generally available (blog)
We will soon migrate and merge the Power Apps portals documentation with Power Pages documentation.

Portal development involves several configurations and customizations to achieve a desired experience for portal end users.

After you have completed development or configuration of your portal instance, you might want to migrate your latest portal configuration from development to testing or the production environments.

Migration involves exporting the existing configuration from the source Microsoft Dataverse environment, and then importing it into the target Dataverse environment.

Prepare the target environment

Note

  • Preparing the target environment is a one-time process. You will need to provision a new portal in order to install the managed portal solutions on Dataverse as well as configure the portal web application. The process also installs default portal metadata which will be replaced with portal metadata from your source environment.
  • Ensure that the target environment's maximum attachment size is set to the same or greater size as your source environment.
  • The maximum size of files is determined by the Maximum file size setting in the system settings email tab in the environment system settings dialog box.
  1. Provision a new portal in your target environment. Use the same portal template as you provisioned on your source environment. For example, if you provisioned the Dynamics 365 Customer Self-Service portal on your source environment, provision the Dynamics 365 Customer Self-Service portal on your target environment.

  2. On the target environment, using the Portal Management app, delete the newly created website record. This will remove the default portal configuration data from the target environment.

    Delete website record.

  3. On the target environment, delete the portal app. This will remove the portal app currently configured to render the default portal.

    Note

    Do not delete the Portal Management app!

    Delete portal app.

  4. Transfer the portal metadata from the source environment using the Power Platform CLI or the Configuration Migration Tool.

  5. On the target environment, provision a new portal using the existing portal website option. This process will configure a portal using the portal configuration you transferred from the source environment.

    Provision new portal.

  6. The portal updates from the source environment should be reflected in this new target environment. Going forward, you should be able to transfer configuration from your source to target environments by transferring the portal configuration data.

Transfer portal metadata

Note

Effective October 12, 2022, Power Apps portals is Power Pages. More information: Microsoft Power Pages is now generally available (blog)
We will soon migrate and merge the Power Apps portals documentation with Power Pages documentation.

Transfer portal configuration using Power Platform CLI

The Microsoft Power Platform CLI provides many features specifically for portals. These commands allow you to download portal configuration from a source environment and transfer it to a target environment. These commands can also be incorporated into your ALM processes.

  1. Create Power Platform CLI authentication profiles to connect to both your source and target environments. You can give them a name to easily identify the target and source environments.

    pac auth create --name [name] --url [environment url]
    

    Example

    pac auth create --name PORTALDEV --url https://contoso-org.crm.dynamics.com
    
  2. When the authentication profiles are created, they'll have an associated index that can be determined using the list command.

    pac auth list
    

    List of environments.

  3. Select the Power Platform CLI authentication profile connected to the source environment.

    pac auth select --index [source environment index]
    

    Example

    pac auth select --index 1
    
  4. Determine the website ID for the source portal.

    pac paportal list
    

    List of portals.

  5. Download the portal configuration data to your local workstation. Use the --overwrite option set to true if you have previous downloaded portal configuration to the same path.

    pac paportal download --path [path] --webSiteId [website id]
    

    Example

    pac paportal download --path c:\paportals\ --webSiteId db9db518-ea5c-ec11-8f8f-00224804e6cd
    
  6. Select the Power Platform CLI authentication profile connected to the target environment.

    pac auth select --index [target environment index]
    

    Example

    pac auth select --index 2
    
  7. Upload the portal configuration data to the target environment.

    pac paportal upload --path [path]
    

    Example

    pac paportal upload --path "C:\paportals\portaldev"
    

Note

The Power Platform CLI tool does not migrate tables or table schema. Migration may fail with missing elements such as tables and fields when configuration data is mismatched with selected schema. During import, ensure the destination environment contains the same portal type already installed with any additional customizations such as tables, fields, forms or views imported separately as solutions.

Create new portal using migrated data

If the migration process is updating an existing portal, the updates should now be visible in the target environment. If the migration is for a new portal, you can now create the new portal for the imported website record by using the option Use data from existing website record. More information: Create portal

Tenant-to-tenant migration

Power Apps portals doesn't support tenant-to-tenant migration. To migrate a portal from one tenant to another, you must follow these steps:

  1. Reset your portal in the source tenant.

  2. Provision a new portal in an environment with Dataverse or containing customer engagement apps.

  3. Migrate portal configurations and customizations using the steps explained in this article earlier.

See also