Creating site backups and restores

Loading

Power Pages (formerly PowerApps Portals) are built on top of Microsoft Dataverse, combining both content and configuration. Just like any other application, it’s crucial to have a reliable backup and restore strategy to protect your site from unexpected data loss, code errors, or failed deployments.

This guide provides a comprehensive walkthrough on creating backups and performing restores for Power Pages sites using tools like Power Platform Admin Center, Power Platform CLI (PAC CLI), and Dataverse solutions. The goal is to enable you to safeguard your portal configurations and content effectively.


Why Backups Are Important

A solid backup plan ensures that:

  • You can recover from user errors, faulty deployments, or security incidents.
  • You can restore a working version after broken customizations or data corruption.
  • Your data and configurations are safe, traceable, and version-controlled.
  • You support governance and compliance requirements in enterprise environments.

Types of Backups

There are two major categories of backups for Power Pages:

  1. Environment-Level Backup (Managed by Microsoft)
    • Captures all environment data including Power Pages.
    • Scheduled automatically or manually triggered.
    • Includes Dataverse tables, solutions, and portal metadata.
  2. Portal-Specific Backup (Custom/Manual)
    • Includes portal code, web templates, content snippets, etc.
    • Performed using PAC CLI or by exporting solutions and data manually.

1. Environment-Level Backups (Automatic or Manual)

Step 1: Go to Power Platform Admin Center

Step 2: Backup the Environment

  • Click on the Backups tab.
  • Choose + New backup.
  • Enter a backup name (e.g., PreDeployment-Apr16).
  • Choose Include portal data (optional but recommended).
  • Click Create backup.

Note: Backups include all Dataverse data — not just the Power Pages site.

Step 3: Restore from a Backup

  • From the Backups tab, locate the backup you want to restore.
  • Click Restore.
  • You can choose to restore to:
    • Same environment (overwrites existing data).
    • Sandbox environment (test before full restore).

This method is best for full environment recovery.


2. Backing Up Power Pages Portal Code Using Power Platform CLI

PAC CLI allows downloading your Power Pages configuration to a local directory. This is ideal for version control, incremental backups, or CI/CD automation.

Step 1: Install and Authenticate

pac auth create --url "https://yourenv.crm.dynamics.com"

Step 2: Locate Your Portal

pac paportal list

Get the website ID from the output.

Step 3: Download the Portal

pac paportal download --path "C:\PortalBackup\MyPortal" --webSiteId <GUID>

This will download:

  • Web pages
  • Web files
  • JavaScript and CSS
  • Web templates
  • Content snippets

Step 4: Store in Source Control

Push the downloaded portal into GitHub, Azure DevOps, or any source control platform to maintain versions and track changes.


3. Backing Up Data and Schema (Optional)

In addition to portal configuration, you might want to back up:

  • Table schema
  • Sample/critical data
  • Portal management settings (Entity Permissions, Web Roles, etc.)

Export as a Managed or Unmanaged Solution

  1. Go to Power Apps Maker Portal: https://make.powerapps.com
  2. Navigate to Solutions.
  3. Create a new solution or use an existing one.
  4. Add all portal-related tables and components.
  5. Export the solution (managed/unmanaged).

You can store the .zip file in your version control or pipeline.

Export Sample Data with Configuration Migration Tool

Use the Configuration Migration Tool to extract:

  • Lookup tables
  • Web role data
  • Content snippets, etc.

This ensures that your portal data can be recreated consistently across environments.


4. Restoring a Portal Using PAC CLI

When you need to roll back or recreate the portal:

Step 1: Re-authenticate if necessary

pac auth select --index <auth-profile>

Step 2: Upload Portal Files

pac paportal upload --path "C:\PortalBackup\MyPortal"

All web pages, templates, and files will be re-uploaded to the environment.

Combine with a solution import and data import to fully rehydrate the portal.


5. Automating Backup and Restore with CI/CD

You can include portal backup and restore tasks in your GitHub Actions or Azure DevOps Pipelines.

Example GitHub Step to Backup Portal:

- name: Backup Portal
run: |
pac auth create --clientId ${{ secrets.CLIENT_ID }} --clientSecret ${{ secrets.CLIENT_SECRET }} --tenant ${{ secrets.TENANT_ID }} --url ${{ secrets.ENV_URL }}
pac paportal download --path src/backup --webSiteId ${{ secrets.PORTAL_ID }}

Use schedules (cron) or manual triggers (workflow_dispatch) to automate it daily or weekly.


6. Backup Strategy Best Practices

PracticeDescription
Automate BackupsUse scripts or scheduled GitHub Actions to back up regularly
Store SecurelyStore backups in version control or cloud storage with restricted access
Test Restores PeriodicallyTest restore process regularly to ensure it’s valid and fast
Separate by EnvironmentUse separate folders or branches for dev, test, and production backups
Document All ChangesKeep a changelog for all portal deployments and backups

7. Common Challenges and Solutions

IssueSolution
Portal fails after uploadDouble-check dependent data, roles, and permissions
Partial backup (missing content)Use full download via PAC CLI and export solutions for data/schema
Version conflictsUse git versioning with clear commit messages
Restore fails in new environmentValidate solution dependencies and portal language settings

Leave a Reply

Your email address will not be published. Required fields are marked *