I Accidentally Deleted My Power Pages Site… Now What?
Kimberly Retherford
Sales Excellence Manager @ TricorBraun | Veteran | Ex-Microsoft
Did your heart drop when you realized you deleted the wrong site by mistake? How about when you realized a colleague deleted the site you had spent hundreds of hours working on?
First, take a deep breath! You're not the first person who has encountered this and thankfully, you'll more than likely be able to recover your configurations without needing to roll back your environment.
Let's take a look at the different ways your site could have been deleted and what actually happens during the deletion process.
Deletion Scenarios
1 - Through the Power Pages studio
2 - Through the Power Apps maker portal
3 - Through the Power Platform admin center
4 - Through the Portal Management application
If a site was deleted via scenarios #1, #2, or #3, the only thing that was deleted was your website host and associated resources. Your host is the code that actually forms your website which runs as an Azure web application. Your Power Pages site application will also no longer be present in your list of applications.
We also see this occur when your site exceeds the trial period. Part of the Power Pages site lifecycle is that after the initial provisioning of a site, you have 30 days to convert that site to a production site. If you don't convert to production, your site enters a disabled state for 7 days. After those 7 days, your site is deleted.
What is not deleted is the import piece here - your configurations and solutions.
Though your site itself has been deleted, your configurations and solutions still exist within Microsoft Dataverse. This means that you can apply these existing configurations to a new site such as the pre-existing web pages, web roles, content snippets, and most importantly, the website record.
?Let's look into how we can rebuild with existing configurations.
Applying Old Configurations To A New Site - Scenarios #1, 2, 3 - New Method
This new capability has made it incredibly easy to provision a new site with your old configurations through the Power Pages home page.
When on the home page, a list of your active sites will be displayed. Navigate to the Inactive sites tab.
As long as it was the website host that was deleted, and not the website record, you should see your old site within this list.
From here, you'll click on the Reactivate button that is present on the appropriate site. When you do so, you'll have the opportunity to change the website name as well as the web address. Once you're ready, click Done, and your site will be reactivated with all of the old configurations. Huzzah!
Applying Old Configurations To A New Site - Scenarios #1, 2, 3 - Old Method One
The newer method mentioned above is the recommended approach, but it's important to know about some of the other options that are available to you as well.
In this method, before we can apply the old configurations to a new site, we need to create the new site. When you do so, ensure you are creating a new site with the same template as the one that was deleted. Once the provisioning is done, you can proceed.
To understand how we can use old configurations or an old website record, we first need to understand website bindings.
领英推荐
I like to refer to website bindings as the glue that holds everything together. A website binding provides the link between the site metadata stored in Dataverse and the site Azure web application.
It's not a best practice to directly edit this website binding through the Portal Management application, but we can modify this by going over to the Power Platform admin center.
//Tech Tip: Be careful! Messing up your website bindings can cause a lot of damage. Only do this when it is absolutely necessary.
In the Power Platform admin center, you'll open up the site that you had just created and click the Edit button that is present within the Site Details section. A pane will appear to the right hand side with additional details regarding this new site.
Dropdown the field that says Website Record.
In this list you should see the website record of your previous site that was deleted. Remember, the host was deleted, not these website records! Go ahead and select the website record that belonged to the old site and save your changes at the bottom. As long as your configurations are still tied to the old website record, all of these configurations should now be present within your new site after Dataverse and the design studio sync.
Applying Old Configurations To A New Site - Scenarios #1, 2, 3 - Old Method Two
This time we're going to create a site through an older method - the Power Apps maker studio.
Navigate to Apps on the left-hand side. In the top ribbon, select + New app, then select Website.
Within the pop-up window, enter the required information. Toward the bottom you'll want to click the checkbox that says, "Use data from existing website record". Once you check that box, you'll have a drop down where you can select your old website record. Click Create and your new site will be created with your old configurations!
//Tech Tip: If you use this method, your application with be created as type "Portal" rather than "Power Pages". You'll still be able to use the design studio with all of its functionality, your application will just be a different type. We're hoping to see this capability added into the Power Pages maker studio in the near future.
What To Do If Your Actual Website Record Was Deleted - Scenario #4
What happens if your scenario fell under #4 toward the top of this post? Well, it's not good, but it's not completely hopeless.
Whenever you delete a website record, all the related configurations are also deleted. That means the web pages, web roles, site setting, etc. will vanish. This is an expected behavior as with most scenarios if you're intentionally deleting a website record, you would want all the associated configurations to also be deleted so you wouldn't need to manually remove hundreds of records.
Though this is a helpful functionality, it could prove troublesome if you mistakenly deleted this website record.
With the website record gone, you're unable to use that in a website binding, so your only real option is to restore the environment to a previous version. This option is not for everyone, especially if you're in the middle of the development cycle for other projects within the same environment.
If you are interested in this approach, you can find details on how to do so here: Back up and restore environments
After you've completed the backup and restore actions, the environment you've restored to will now contain your old website record that you could then use with any of the methods mentioned above.
Back to Normal Operations
My fingers are crossed that you never have to experience the panic associated with accidentally deleting a site, but in the event you do, I hope this proves helpful!
Remember to check twice before clicking delete.
Happy learning!
-Kim
Managing Consultant - Microsoft Dynamics 365 CE, Power Platform
1 年Mia S?eborg - do you remember this scenario? ??
Low Code Lead & Architect ? Licensing Specialist ? Pre-Sales ? Power Platform(Power Apps, Power Automate, Power BI, Copilots & Power Pages), SharePoint & VIVA Consulting ? COE ? Administration ? YouTube @PowerTrainer
1 年This is really a great and comprehensive article, not only shows how to restore and reactivate the deleted site, but also shows 4 ways to delete(which I liked as well) ?? Thank you, Kimberly Retherford!
Chief Schools Officer at Knowness | Freelance D365 & Power Platform Developer at Cajarno | Director at Broximo Prestige Steeds - Passionate About EdTech, Business Applications, and all things Bikes.
1 年A very good reason to start using source control. Always commit your work so that you have a backup and traceable history to go back to when your portal/functionality was working ?? It's very easy to setup, especially with vs code ??. No need for anything fancy and you can use Azure Devops and link stories to pull requests. P. S. Love the cat ??
Practice Lead Field Service & Project Operations at HSO | Leading Digital Transformations
1 年Martijn Aangeenbrug
Power Platform Practice Lead at Itera | Microsoft MVP | Cohost of the Power Platform BOOST Podcast
1 年Great work Kimberly Retherford! I'm impressed ??