web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / unable to copy or rest...
Power Apps
Unanswered

unable to copy or restore a managed environment

(0) ShareShare
ReportReport
Posted on by 601

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?!?

I have the same question (0)
  • velegandla Profile Picture
    204 Moderator on at

    @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 

    Velegandla_0-1678847561098.pngVelegandla_1-1678847571941.png

    ---

    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/ 

     

  • KoJaPD Profile Picture
    601 on at

    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?

  • velegandla Profile Picture
    204 Moderator on at

    @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.

    Velegandla_0-1678863696257.png

    sorry, I was previously testing the developer type. 

     

  • KoJaPD Profile Picture
    601 on at

    I had opened a ticket with MS Support, and they acknowledged something is wrong; they will investigate...

  • velegandla Profile Picture
    204 Moderator on at

    @KoenJanssensPD Please do keep us updated with the findings. Thanks

  • KoJaPD Profile Picture
    601 on at

    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...

  • velegandla Profile Picture
    204 Moderator on at

    @KoenJanssensPD 

    Maybe Microsoft does not want to expose other configurations in Powershell other than the "ProtectionLevel"

    Velegandla_0-1679312877466.png

     

  • KoJaPD Profile Picture
    601 on at

    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...

  • foyinb Profile Picture
    6 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard