export a subsite webpart could not be found, or is not registered as saf

Sajith Gopalakrishnan Hema 1,036 Reputation points
2020-09-13T05:09:47.547+00:00

I am trying to export a subsite from the Central Admin. The log file **.cmp.export.log shows the below warning and import is getting failed.

9/10/2020 4:55:08 PM] [File] [default.aspx] [/rc/default.aspx] [1ccc9611-6534-4a5a-85e8-87fc8a04f393] [Verbose] Exporting Web Part
[9/10/2020 4:55:08 PM] [File] [default.aspx] [/rc/default.aspx] [1ccc9611-6534-4a5a-85e8-87fc8a04f393] [Warning] A Web Part or Web Form Control type on page /rc/default.aspx could not be found, or is not registered as safe. The Web Part will still be exported.

Unable to find the webpart using the GUID ID - 1ccc9611-6534-4a5a-85e8-87fc8a04f393. How can I find the WebPart ?

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,961 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ChelseaWu-MSFT 6,326 Reputation points
    2020-09-14T03:08:25.06+00:00

    A few options you can use to get the web part using GUID:

    1 Iterate through every web part page in the subsite. Try using SharePoint Designer 2013 to open the pages and search for "WebPartId" and see if you can get the result.

    24228-screenshot-2020-09-14-105323.png

    2 Run database query on all content databases, which might be different based on which version of SharePoint you are using.
    Here is a sample query for SharePoint Server 2013:

    SELECT DISTINCT D.SiteID, D.WebId, W.FullURL as WebURL, D.Id As DocumentId,  
                    D.DirName, D.LeafName, tp_ID As WebPartSK  
    FROM       dbo.Docs D WITH (nolock)   
    INNER JOIN dbo.Webs W WITH (nolock) ON D.WebID = W.Id  
    INNER JOIN dbo.AllWebParts WP WITH (nolock) ON D.Id = WP.tp_PageUrlID  
    WHERE WP.tp_ListId Is Null AND WP.tp_Type Is Null AND WP.tp_Flags Is Null  
          AND WP.tp_BaseViewID Is Null AND WP.tp_DisplayName Is Null   
          AND WP.tp_Version Is Null  
    AND WP.tp_WebPartTypeId='<your web parts id>'  
    

    Please refer to a post with similar request here for further information: Sharepoint find where webpart is in use.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    **Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **

    0 comments No comments

  2. Sajith Gopalakrishnan Hema 1,036 Reputation points
    2020-09-14T06:51:24.063+00:00

    The SharePoint Version is 2016 and the above step did not help.

    I refered the below forum link and able to get the faulyt webpart ID by querying the database

    https://social.technet.microsoft.com/Forums/en-US/4be045fa-5201-4a2b-89a5-8cd767c2ec5d/how-to-find-out-if-and-where-a-webpart-is-used?forum=sharepointadminprevious

    24388-tp-id.png

    Located the bad markup rows.

    24376-badmarkup.png

    Removed it by using SQL Query. I know that it is not advised to execute the SQL query in the Content Database. Please advise.

    24300-markupcleaned.png

    After this export log does not show any error or warning.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.