Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan 1288 posts 3921 karma points c-trib
    Oct 09, 2009 @ 17:49
    Dan
    0

    Change document type

    Hi,

    I need to change the document type of my top node page.  I've read similar posts which say that this is not possible via the UI, but that it may be possible either directly within the database or by copying/pasting nodes.

    Question is, what is the best way to go about this?  I literally just need the singel 'home' node (the top level node on the site) to use a different document type.

    Thanks folks

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Oct 09, 2009 @ 20:41
    Richard Soeteman
    0

    Hi Dan,

    I would change this in the database directly. Make a backup before you start :)

    Cheers,

    Richard

  • Dan 1288 posts 3921 karma points c-trib
    Oct 12, 2009 @ 11:51
    Dan
    0

    Thanks Richard.  Any pointers as to where to look in the database?

  • Dan 1288 posts 3921 karma points c-trib
    Oct 12, 2009 @ 12:50
    Dan
    0

    I thought it might be as simple as changing the value of the contentType field in the cmsContent table, but that yields the following error when I try to edit the page in Umbraco:

    Server Error in '/' Application.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
    umbraco.controls.ContentControl.addControlNew(Property p, TabPage tp, String Caption) +54
    umbraco.controls.ContentControl..ctor(Content c, publishModes CanPublish, String Id) +780
    umbraco.cms.presentation.editContent.OnInit(EventArgs e) +368
    System.Web.UI.Control.InitRecursive(Control namingContainer) +333
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378



    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

     

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Oct 12, 2009 @ 13:33
    Sebastiaan Janssen
    1

    I would just make a new root node and move all the content from the current root node to the new one (with the new document type), when that's done you can delete the old document that you don't need any more.

  • Dan 1288 posts 3921 karma points c-trib
    Oct 12, 2009 @ 13:39
    Dan
    0

    Thanks Sebastian, I didn't know if this would work, being the root node.  I'll give it a try next time though.  This time, I actually did the database change as per above and then republished everything from the root node and that cleared the error, so it does seem to have worked.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Aug 10, 2010 @ 13:04
    Jeroen Breuer
    0

    Wouldn't it be possible to create a package which can let the user change the document type of a node? Something like the Doc Type Extensions package? Don't know if it's possible.

     

  • samit 2 posts 22 karma points
    Nov 11, 2011 @ 22:55
    samit
    0

    Change it from the DB -

     

     

     

     

     

     

    --1 -- change the contenttypeID (Doing this alone is not enough)

     

     

     

     

     

    UPDATE 

    cmsContent SET 

     

    contentType = 'new content t' WHERE  nodeId='your node id'

     

    --2 Change the content type in the xml content

    update

    cmsContentXml set the content type in xml

     

    --3 Change/ Map all the properties of the contenttype to the desired contenttype properties

    Update cmsPropertyData table for this

    And Voilla you are done !!!

     

  • samit 2 posts 22 karma points
    Nov 11, 2011 @ 22:58
    samit
    0
    • Change it from the DB -

    • --1 -- change the contenttypeID (Doing this alone is not enough) 

    • UPDATE cmsContent SET contentType = 'new content t' WHERE  nodeId='your node id'

    •  --2 Change the content type in the xml content

    • update cmsContentXml set the content type in xml

    •  --3 Change/ Map all the properties of the contenttype to the desired contenttype properties

    • Update cmsPropertyData table for this

    • And Voilla you are done !!!

     

     

  • Stuart Neal 9 posts 29 karma points
    Mar 16, 2012 @ 11:10
    Stuart Neal
    0

    There is a feature request for this - vote it up at http://issues.umbraco.org/issue/U5-61

  • Tim Watts 90 posts 395 karma points
    Sep 13, 2013 @ 11:08
    Tim Watts
    0

    Hi,

    I know this thread is old but I wanted to update.

    The reply from Samit says that you need to change the cmsContentXml table.  I don't think that this is true, this table is changed when publishing so all you need to do is republish the nodes which have had the content type changed and this will be regenerated.

    Tim

     

  • Andy Vennells 19 posts 59 karma points
    May 26, 2015 @ 09:36
    Andy Vennells
    0

    I can't highfive but both Samit and Tim Watts are correct.  

Please Sign in or register to post replies

Write your reply to:

Draft