Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Unanswered

unable to copy or restore a managed environment

(0) ShareShare
ReportReport
Posted on by 595

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

  • foyinb Profile Picture
    6 on at
    Re: unable to copy or restore a managed 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

  • KoJaPD Profile Picture
    595 on at
    Re: unable to copy or restore a managed environment

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

  • velegandla Profile Picture
    202 Super User 2025 Season 1 on at
    Re: unable to copy or restore a managed environment

    @KoenJanssensPD 

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

    Velegandla_0-1679312877466.png

     

  • KoJaPD Profile Picture
    595 on at
    Re: unable to copy or restore a managed environment

    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
    202 Super User 2025 Season 1 on at
    Re: unable to copy or restore a managed environment

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

  • KoJaPD Profile Picture
    595 on at
    Re: unable to copy or restore a managed environment

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

  • velegandla Profile Picture
    202 Super User 2025 Season 1 on at
    Re: unable to copy or restore a managed environment

    @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
    595 on at
    Re: unable to copy or restore a managed environment

    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
    202 Super User 2025 Season 1 on at
    Re: unable to copy or restore a managed environment

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

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Governance and Administering

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 11 Super User 2025 Season 1

#2
bscarlavai33 Profile Picture

bscarlavai33 5 Super User 2025 Season 1

#3
getsplash Profile Picture

getsplash 2

Overall leaderboard

Featured topics