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:
- 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.
- 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
- Navigate to: https://admin.powerplatform.microsoft.com/
- Choose Environments from the left navigation.
- Select the environment that contains your Power Pages site.
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
- Go to Power Apps Maker Portal: https://make.powerapps.com
- Navigate to Solutions.
- Create a new solution or use an existing one.
- Add all portal-related tables and components.
- 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
Practice | Description |
---|---|
Automate Backups | Use scripts or scheduled GitHub Actions to back up regularly |
Store Securely | Store backups in version control or cloud storage with restricted access |
Test Restores Periodically | Test restore process regularly to ensure it’s valid and fast |
Separate by Environment | Use separate folders or branches for dev, test, and production backups |
Document All Changes | Keep a changelog for all portal deployments and backups |
7. Common Challenges and Solutions
Issue | Solution |
---|---|
Portal fails after upload | Double-check dependent data, roles, and permissions |
Partial backup (missing content) | Use full download via PAC CLI and export solutions for data/schema |
Version conflicts | Use git versioning with clear commit messages |
Restore fails in new environment | Validate solution dependencies and portal language settings |