Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 187885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:54:13+00:00 2026-05-11T15:54:13+00:00

Edit: This is a decade old so very likely not to be relevant to

  • 0

Edit: This is a decade old so very likely not to be relevant to anyone, if google has brought you here I would be sceptical of the content against more modern frameworks!

We have a sharepoint website that has been quite heavily developed with content using the out of the box content editor webpart. This is a bit rubbish when it comes to using any other browser than IE.

We have in mind to update to the free Telerik content editor, however we would like to save ourselves a large amount of copy and pasting, and clicking and selecting to swap the web parts over.

There seems to be no official upgrade path but it seems to me that it must be possible to use the power of code ™ to grab the content of the original webpart, new up a telerik webopart and put the content into the new webpart… then delete the old original web part.

Has anyone done this sort of thing? How is it best to lay out the code and actually run the code that will do the swap (if it is possible). A fresh webpart with a ‘Do Swap’ button on? or something more sophisticated?

I also would need to walk through every page and subsite (and page in subsite) and look at every web part. Is there a best practice way of doing this?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:54:14+00:00Added an answer on May 11, 2026 at 3:54 pm

    I would write a console application for this.

    Open the root Web and iterate through its sub webs. Do the work needed for each page, by opening the WebPartManager.

    Here are some pseudo code to get you started.

    string SourceUrl = 'http://ThisWeb';  using (SPSite sourceSite = new SPSite(SourceURL)) {     using (SPWeb sourceWeb = sourceSite.OpenWeb(SourceURL))     {         IterateSubWebsProd(sourceWeb):     } }  private void IterateSubWebsProd(SPWeb sourceWeb) {     // This is the migration function     DoThingyWithThisWeb(sourceWeb);      foreach (SPWeb subWeb in sourceWeb.Webs)     {       IterateSubWebsProd(subWeb);       subWeb.Dispose();     } }  private void DoThingyWithThisWeb(SPWeb sourceWeb) {     PublishingPage currentPage = null;      string currentPageName = '<something>';     // Find the pages that you want to modify, with a CAML query for example     SPQuery query = new SPQuery();     query.Query = string.Format('' +     '<Where>' +       '<Eq>' +          '<FieldRef Name='FileLeafRef' />' +          '<Value Type='File'>{0}</Value>' +       '</Eq>' +     '</Where>' +     '', currentPageName);        // This codesnippet is from a Publishing web example      PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(sourceWeb);     PublishingPageCollection pageColl = publishingWeb.GetPublishingPages(query);     if (pageColl.Count > 0)     {         currentPage = pageColl[0];     }      using (SPLimitedWebPartManager wpMan = currentPage.ListItem.File.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared))     {         foreach (WebPart wp in wpMan.WebParts)         {             if (wp.GetType().Equals(typeof(Microsoft.SharePoint.WebPartPages.ContentEditorWebPart)))             {                 Microsoft.SharePoint.WebPartPages.ContentEditorWebPart thisWebPart = wp as Microsoft.SharePoint.WebPartPages.ContentEditorWebPart;                  // This is just dummy code, here you will do your content migration                  XmlDocument xmlDoc = new XmlDocument();                 XmlElement xmlElement = xmlDoc.CreateElement('RootElement');                 xmlElement.InnerText = sourceItem[SourceField].ToString();                 thisWebPart.Content = xmlElement;                  wpMan.SaveChanges(thisWebPart);             }         }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit This question has gone through a few iterations by now, so feel free
EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
EDIT: This is not a question on how I can programatically set expiration. I
Edit: This problem was down to me passing the wrong view to the Touch
edit This question is solved! Having something weird. I'm using html { font-size: 100%
Edit: this question is outdated. The jsonlite package flattens automatically. I am dealing with
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
EDIT: This question is a duplicate of What is the difference between managed and
EDIT: This issue is already submitted on Github. Changing the Act part to this
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.