SharePoint publishing page replace file url(FTP) with http SPO library url

Shri-6058 326 Reputation points
2022-02-04T03:54:17.567+00:00

Hi,

We are in a process of migrating SP 2013 portal sites into SPO online. There are many LAN file links published via content editor webpart(FTP). Now we have decided to migrate all LAN/FTP files into SPO libray. Since there are 100s of link to be replaced, I am checking if there is any application which helps to replace the url. For example:

Current SP 2013 portal LAN link is published in SP 2013 site home page: \cm-prod-2019\EmployeeCVs\LastName_FirstName_EmpCode.docx
The new SPO online link for the same CV would be https://CMProdUS.SharePoint.com/sites/employee/EmpRepository/LastName_FirstName_EmpCode.docx

I tried manually during proof of concept however we have 1000s of links. If I try to checkout the .aspx page and update the html code, I cant check that page back in with pagelayout. I am afraid of losing customizations and hence I want to explore options to replace all file network link with http link one page by one page or one site by one site. whaever way is just fine but we cant handle manually.

Appreciate any sample, application link which I can run to replace the links.

Thanks
Shri

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,247 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,833 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,706 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,577 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,156 Reputation points Microsoft Vendor
    2022-02-04T07:40:22.817+00:00

    Hi @Shri-6058 ,
    You can refer to following PowerShell Script to find and replace links from the Content Editor Web Part in this article.
    https://www.sharepointdiary.com/2013/04/replace-cewp-links-with-powershell.html

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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. sadomovalex 3,626 Reputation points
    2022-02-04T15:08:46.3+00:00

    I cant check that page back in with pagelayout. I am afraid of losing customizations

    which customizations you afraid to lose? If you only updated html link in page html content field or web part customizations won't be lost. You got idea correctly: you need to go through all pages and for each page check it out, modify page content (replace old links by new ones) and check it in back. You may do it by PowerShell e.g. like this: PowerShell script for fixing urls inside Content editor and Image viewer web parts in Sharepoint.

    0 comments No comments

  3. Shri-6058 326 Reputation points
    2022-02-08T21:25:59.24+00:00

    Thank you all. I went through both articles. These powershell scripts are working just fine for SharePoint 2013(though the script needs fixing) however the library is not available for SharePoint Online.

    Also, I wanted to check if there are any Jquery based tool to integrate it in Master page, so it will check during the load time and replace it with SPO link. My problem is source LAN location is not just one location and its distributed amoun 40-50 different locations. My plan is the create one document library in SPO however I have to move/copy these source files into SPO document library. Do you have any other idea to implement one subsite or publishing page at a time option?

    Please advise