Copied to clipboard

Flag this post as spam?

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


  • Psib3r 70 posts 119 karma points
    Jan 10, 2013 @ 10:52
    Psib3r
    0

    New Document Type

    Hi, I am looking to change every page to a new document type, does anybody have an axample query to do this?

  • Matt Barlow | jacker.io 164 posts 740 karma points c-trib
    Jan 10, 2013 @ 13:49
    Matt Barlow | jacker.io
    0

    http://our.umbraco.org/forum/templating/templates-and-document-types/4585-Change-document-type

    1. Back up your database.

    2. Update cmsContent (replace the old contentype with the new one)

    Update cmsContent set contentType='OLDTYPEID' where contentType='NEWTYPEID'

    3. Update cmsContentXml

    SELECT cast(replace(cast([xml] as nvarchar(max)),'nodeType="OLDTYPEID"','nodeType="NEWTYPEID"') as ntext) FROM cmsContentXML INNER 
    JOIN cmsContent
    ON cmsContentXML.nodeId = cmsContent.nodeId
    WHERE cmsContent.contentType='NEWTYPEID'

    4. Update cmsPropertyData - map the properties of one the old type to the new one.

    Select * FROM cmsPropertyData INNER JOIN cmsContent 
    ON cmsPropertyData.contentNodeId = cmsContent.nodeId
    WHERE cmsContent.contentType='NEWTYPEID'

    That will give you the properties, then you can write your own sql to update these.

    Hope that helps.

    Matt

     

  • Psib3r 70 posts 119 karma points
    Jan 14, 2013 @ 12:31
    Psib3r
    0

    Thanks for this I am going to give it a go shortly, I will be doing this on my local copy and couriering the changes to the live server, I am assuming everything should be ok with couriering the changes?

Please Sign in or register to post replies

Write your reply to:

Draft