locked
Convert classic SharePoint 2019 web part page to modern RRS feed

  • Question

  • Hello all,

    I'm trying to convert classic SharePoint 2019 on-premises web part page to modern using the following script "Convert-OnPremisesPublishingPages.ps1"

    But I'm getting the following error:

    -------------------------------------------------------------------------------------------------------

    PS D:\TOOLS\Mapping-2010> .\Convert-OnPremisesPublishingPages.ps1 -SourceCredentials $sourceCredentials -SourceUrl "https://teamsites.contoso.com" -TargetSitePartUrl "ClassicToModern" -TargetCredentials $targetCredentials
    Connecting to  https://teamsites.contoso.com  and  https://alekpavlov.sharepoint.com/sites/ClassicToModern
    Connected to  https://teamsites.contoso.com
    Connected to  https://alekpavlov.sharepoint.com/sites/ClassicToModern
    Converting site...
     Processing Home.aspx
     Modernizing Home.aspx...
    ConvertTo-PnPClientSidePage : File Not Found.
    At D:\TOOLS\Mapping-2010\Convert-OnPremisesPublishingPages.ps1:131 char:19
    + ...   $result = ConvertTo-PnPClientSidePage -Identity $page.FieldValues[" ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : WriteError: (:) [ConvertTo-PnPClientSidePage], ServerException
        + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage
      Page not transformed, check the logs for issues
     Processing How To Use This Library.aspx
     Modernizing How To Use This Library.aspx...
    ConvertTo-PnPClientSidePage : File Not Found.
    At D:\TOOLS\Mapping-2010\Convert-OnPremisesPublishingPages.ps1:131 char:19
    + ...   $result = ConvertTo-PnPClientSidePage -Identity $page.FieldValues[" ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : WriteError: (:) [ConvertTo-PnPClientSidePage], ServerException
        + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.ClientSidePages.ConvertToClientSidePage
      Page not transformed, check the logs for issues
    Script Complete! :)
    PS D:\TOOLS\Mapping-2010>

    -------------------------------------------------------------------------------------------------------

    These are the errors I'm getting in ULS log:

    • System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002), StackTrace:   
       at Microsoft.SharePoint.SPWeb.GetList(String relUrl, SPResourcePath path)    
       at Microsoft.SharePoint.SPWeb.GetList(String strUrl)    
       at Microsoft.SharePoint.ServerStub.SPWebServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)    
       at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.InvokeMethod(Object obj, String methodName, XmlNodeList xmlargs, Boolean& isVoid)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPath(XmlElement xe)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.GetObjectFromObjectPathId(String objectPathId)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessInstantiateObjectPath(XmlElement xe)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.ProcessStatements(XmlNode xe)    
       at Microsoft.SharePoint.Client.ClientMethodsProcessor.Process()    
       at Microsoft.SharePoint.Client.ClientRequestServiceImpl.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)    
       at Microsoft.SharePoint.Client.ClientRequestService.ProcessQuery(Stream inputStream)    
       at SyncInvokeProcessQuery(Object , Object[] , Object[] )    
       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)    
       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)    
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)    
       at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)    
       at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)    
       at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)    
       at System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)    
       at System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult result)    
       at System.ServiceModel.Dispatcher.ChannelHandler.OnAsyncReceiveComplete(IAsyncResult result)    
       at System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)    
       at System.Runtime.AsyncResult.Complete(Boolean completedSynchronously)    
       at System.Runtime.InputQueue`1.AsyncQueueReader.Set(Item item)    
       at System.Runtime.InputQueue`1.EnqueueAndDispatch(Item item, Boolean canDispatchOnThisThread)    
       at System.Runtime.InputQueue`1.EnqueueAndDispatch(T item, Action dequeuedCallback, Boolean canDispatchOnThisThread)    
       at System.ServiceModel.Channels.SingletonChannelAcceptor`3.Enqueue(QueueItemType item, Action dequeuedCallback, Boolean canDispatchOnThisThread)    
       at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.CompleteParseAndEnqueue(IAsyncResult result)    
       at System.ServiceModel.Channels.HttpPipeline.EnqueueMessageAsyncResult.HandleParseIncomingMessage(IAsyncResult result)    
       at System.Runtime.AsyncResult.SyncContinue(IAsyncResult result)    
       at System.ServiceModel.Channels.HttpPipeline.EmptyHttpPipeline.BeginProcessInboundRequest(ReplyChannelAcceptor replyChannelAcceptor, Action dequeuedCallback, AsyncCallback callback, Object state)    
       at System.ServiceModel.Channels.HttpChannelListener`1.HttpContextReceivedAsyncResult`1.ProcessHttpContextAsync()    
       at System.ServiceModel.Channels.HttpChannelListener`1.BeginHttpContextReceived(HttpRequestContext context, Action acceptorCallback, AsyncCallback callback, Object state)    
       at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)    
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()    
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()    
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state)    
       at System.ServiceModel.AspNetPartialTrustHelpers.PartialTrustInvoke(ContextCallback callback, Object state)    
       at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequestWithFlow(Object state)    
       at System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)    
       at System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)    
    • Original error: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)    
       at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, StorePath spPath, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)    
       at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, StorePath spPath, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)    
       at Microsoft.SharePoint.SPWeb.GetList(String relUrl, SPResourcePath path)    
       at Microsoft.SharePoint.SPWeb.GetList(String strUrl)    
       at Microsoft.SharePoint.ServerStub.SPWebServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid)    
       at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)

    -------------------------------------------------------------------------------------------------------

    Can someone help me?

    Thank you.




    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.



    Thursday, December 12, 2019 10:25 AM

All replies

  • No you can't convert classic web part page to modern web page in SharePoint Server 2019, The above command only works for SharePoint Online not for SharePoint On-premises. You have to rebuild the page in SharePoint 2019.

    Thanks & Regards,


    sharath aluri

    Thursday, December 12, 2019 12:55 PM
  • Hi,

    As Sharath said, the script you refer to doesn’t support SharePoint Server 2019 for the time being.

    The PnP PowerShell command ConvertTo-PnPClientSidePage is only supported in SharePoint Online.

    I'm afraid it is currently not possible to convert web pat page to modern page in SharePoint Server 2019.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, December 13, 2019 2:00 AM
  • Hi,

    I'm checking how it is going on with this issue.

    Please remember to update this thread if you have any progress.

    Thank you for your understanding.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, December 16, 2019 1:40 AM
  • Hi,

    I was able to convert classic page to modern in SharePoint 2019 on-premises. I'll write an article and post it here.

    Regards

    Aleks 


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.

    Monday, December 16, 2019 8:54 AM
  • Hi,

    Congratulations on finding a solution.

    We are looking forward to your update.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, December 20, 2019 2:30 AM
  • Did you ever write that article? I'm struggling with this exact issue right now.
    Wednesday, April 1, 2020 5:29 PM