Dear,
it seems that it is somehow impossible to copy or restore a managed production environment to another (managed or unmanaged) sandbox environment. Whenever I choose a managed environment to copy or restore, I get "no valid targets" in the environment picker. If I do the same from a non-managed environment, only the non-managed sandbox environments appear in the target environment picker...
The pac cli gives me the following error for both copy and restore commands:
Copying environment...
Microsoft PowerPlatform CLI
Version: 1.21.8+ga93a2c3
Error: The governance configuration properties of the target and source environments must match to perform a copy.
Restoring environment from source 'https://xxxx.crm4.dynamics.com/' to target 'https://yyyy.crm4.dynamics.com/'. It will wait for up to 60 min for completion, before failing the operation
Microsoft PowerPlatform CLI
Version: 1.21.8+ga93a2c3
Error: The governance configuration properties of the target and source environments must match to perform a retore.
"Governance configuration" seems to point to the managed vs unmanaged environment option, but I don't see how I can check the differences in configuration between the environments...
anyone knows how we should make a backup or copy of a managed production environment?!?
Yes, this worked for me. I enabled the usage insights and moved the 'Solution Checker' to warm. The basic principle is to ensure that the managed environments settings in the source and target environments match. I did this from the Admin Center. No Scripts required.
Thanks
Microsoft noticed that there *was* a difference between the source and target environment: the "excludeEnvironmentFromAnalysis" setting (to include the environment in the insight digest).
It is however not logical that this setting prevents copy/backup an environment; it is not desirable that a "backup" environment is included in the insight digest; so we need to remember to disable this setting after the backup has completed...
Maybe Microsoft does not want to expose other configurations in Powershell other than the "ProtectionLevel"
I got a response from MS to copy the Governance Configuration from the source to the target environment using the following CLI script:
Add-PowerAppsAccount
$source = Get-AdminPowerAppEnvironment -EnvironmentName [GUID-OF-SOURCE-ENVIRONMENT]
$target = Get-AdminPowerAppEnvironment -EnvironmentName [GUID-OF-TARGET-ENVIRONMENT]
Set-AdminPowerAppEnvironmentGovernanceConfiguration -EnvironmentName $target.EnvironmentName -UpdatedGovernanceConfiguration $source.Internal.properties.governanceConfiguration
this enabled the target environment to show up in the picklist...
however, I could not find any difference in the $target.Internal.properties.governanceConfiguration before and after the command...
@KoenJanssensPD Please do keep us updated with the findings. Thanks
I had opened a ticket with MS Support, and they acknowledged something is wrong; they will investigate...
@KoenJanssensPD - you might be correct, seems like an issue with Sandbox managed environments. I don't see any other sandbox environment which is of type managed env.
sorry, I was previously testing the developer type.
Hi @Velegandla , the thing is that my target sandbox environment *are* managed as well...
I have even tried to create new managed sandbox environment with database, but it still does not show in the pick list. What other "configuration" should match between the source and target environments and how can we check/change them?
@KoenJanssensPD based on my TEST you can copy from managed to managed environments only. I think its expected behavior and the type should match in this case.
https://learn.microsoft.com/en-us/power-platform/admin/copy-environment
---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
https://www.linkedin.com/in/devendravelegandla/
Michael E. Gernaey
11
Super User 2025 Season 1
bscarlavai33
5
Super User 2025 Season 1
getsplash
2