Skip to main content
Post

#PowerPlatformTip 8: 'Automate Backups & Restores for Flows, Apps & Solutions'

#PowerPlatformTip 8: 'Automate Backups & Restores for Flows, Apps & Solutions'

TL;DR: A scheduled cloud flow calls the Dataverse action ExportSolution for your solution and saves the returned .zip with a date stamp in SharePoint. To restore, import the .zip in Power Apps (Solutions > Import solution). For quick fixes, use the built-in version history of solution flows and the 21-day restore for deleted flows first.

Power Automate already has two safety nets, but neither keeps a copy of your apps and flows outside the environment. A scheduled solution export does.

💡 Challenge

A flow is broken by an edit, an app is overwritten, or a whole environment is reset. Manual exports are easy to forget, and the built-in options have limits:

🔸 Version history exists only for solution cloud flows in the new designer, and it lives in the same environment.

🔸 Deleted flows can be restored by an admin only within 21 days, and they come back disabled.

🔸 Neither covers tables or other components of a solution, and canvas apps only have their own version list inside the same environment.

✅ Solution

Put flows, canvas apps and related components into a solution, and let a scheduled flow export that solution regularly. Each export is a complete .zip you can import into the same or another environment.

🔧 How It’s Done

1. Put everything into a solution.

🔸 In make.powerapps.com, create a solution and add your flows and apps (Add existing > Automation > Cloud flow or App > Canvas app).

2. Create the scheduled backup flow.

🔸 Trigger: Recurrence, for example daily at night.

🔸 Only published customizations are exported (Export solutions). Publish your changes before the scheduled export, or add a publish step before it, and check the first exports in a test import to see that your latest changes are in.

🔸 Action: Perform an unbound action (Microsoft Dataverse) with action name ExportSolution, SolutionName = the solution’s unique name (not the display name), Managed = No.

🔸 Action: Create file (SharePoint) in a backup library:

🔸 File name: @{concat('MySolution_', formatDateTime(utcNow(), 'yyyy-MM-dd'), '.zip')}. A second run on the same UTC day produces the same name; add the time (for example yyyy-MM-dd_HHmm) if the flow may run more than once a day.

🔸 File content: @{base64ToBinary(outputs('Perform_an_unbound_action')?['body/ExportSolutionFile'])}

3. Restore when needed.

🔸 Download the .zip from the library, go to Solutions > Import solution in the target environment and select the file.

🔸 Before you import, check the connection references you are asked to map. Depending on those settings, imported flows may start running as soon as the import ends, so use a test environment first or prepare the import so that no production trigger acts on live data. Then check the connection references again and turn the flows on.

🔸 Do a test restore once: open a downloaded .zip and import it into a test environment, to confirm that the flow wrote a valid solution file and that the components arrive as expected.

4. Use the built-in options for small accidents.

🔸 Broken edit in a solution flow: open the flow in the new designer, open Version history, select the earlier version and restore it.

🔸 Deleted flow: an admin restores it within 21 days with the action Restore Deleted Flow as Admin (Power Automate Management connector) or with Restore-AdminFlow in PowerShell.

🎉 Result

Every night a dated .zip of your solution lands in SharePoint. You can re-import the solution definitions (flows, apps, table definitions) of any day you kept, into the same environment or a new one. That restores the components, not the earlier state of the whole environment or its data, and connections and dependencies in the target environment need to be checked with a test import.

🌟 Key Advantages

🔸 Complete: flows, canvas apps, tables and other solution components in one file.

🔸 Outside the environment: the backup survives an environment reset or deletion.

🔸 Dated: one file per day. Version history of the library does not delete old .zip files, so set a retention or cleanup rule for them yourself (for example a retention label or a scheduled cleanup flow).

⚠️ Good to Know

🔸 Licensing: the Dataverse connector is premium, so the backup flow needs a Power Automate Premium (or Process) licence.

🔸 Unmanaged exports are for backups and restores of your development work. To deploy to test or production, export managed.

🔸 Data is not included: a solution contains components and table definitions, not the records in the tables.

🔸 Protect the backups: exported flow and app definitions can contain values that were typed into actions. Limit read access to the backup library to the accounts that need it, and check exports for embedded secrets.

🎥 Video Tutorial

🛠️ FAQ

1. Does this back up flows that are not in a solution?

No. ExportSolution exports solutions only. Add non-solution flows to a solution first (Add existing > Automation > Cloud flow > Outside Dataverse).

2. Can I back up several environments?

Yes. Build one backup flow per environment, or use the Dataverse action Perform an unbound action in selected environment to target several environments from one flow.

3. How do I restore a single flow from the backup?

Import the solution into a separate test environment, then copy the flow back or export a solution containing only that flow and import it into the original environment.

🔸 How to Restore and Create a Backup from a Flow - the earlier long-form article on flow backups.

🔸 How to Restore an Earlier Version of Your Flow - roll back a single flow to a previous version.

This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy, which runs free live workshops (in German). See the next free workshop dates (in German). For companies that want this implemented for them, see KMUpower: Power Platform consulting & automation for SMEs (DACH).

This post is licensed under CC BY 4.0 by the author.

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.