Copied to clipboard

Flag this post as spam?

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


  • Alex 30 posts 120 karma points
    Feb 01, 2015 @ 03:13
    Alex
    0

    deleting document types? :/

    Hi everyone,

    pretty new to Umbraco here, as I just had limited exposure to the CMS features so far. I am carrying over a project started by someone else and have to add a master document types to a serie of document types. Those document types have content/templates associated to them so I am not too sure what the best approach is.

    My first thought would be to create a Master DocType, then export the existing document types, before updating the xml file to my new master document type, and then re-importing again. I fear however that this would affect existing content? 

    Basically, I am looking for a way to do this safely :) If any. If you have any thoughts on my solutions, please throw them at me.

    Thank you in advance for the responses.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 01, 2015 @ 08:16
    Jan Skovgaard
    0

    Hi Alex and welcome to our :)

    Before you're stating to do this you should of course make sure to take a backup of you're files and the database in case something goes wrong.

    I don't know how to achieve it directly in the database and I don't feel that it's something you should ever touch in the DB unless you're 110% certain of what you're doing.

    What is your purpose of wanting to create a master document type? Is it to make it easier on yourself when you develop the site? What kind of value does it add? I mean like...is it worth the effort?

    If you're using Umbraco 6 or 7 then you can probably use this approach (even though it's very cumbersome if you have a lot of pages)

    1: Create your new master document type

    2: Export your existing document types one-by-one

    3: Import the exported document types under you master document type (But be aware that there could perhaps be document type alias issues, since aliases should be unique to the different document type - It can cause a yellow error screen in the settings section, perhaps also other places, which means that you're not able to edit the document types to change the aliases...)

    4: In the content section you need to right click each node and use the "Change document type" where you can choose another document type for it to be used

    As you can see there are a lot of uncertainties in this approach and it's not very straight forward either - especially not if it's a big site with many document types and a lot of content, so if you're going to go down this path it's essential that you make it easy for yourself to rollback in the case of errors.

    Some of the brighter backend minds in here may perhaps know a simple way of running some SQL in the database that makes this a breeze - But as I mentioned I don't recommend that you mess around with the database directly - But as long you're having a backup you can of course always rollback.

    Another approach could however be to perhaps setup a new Umbraco instance where you create the master document type and then import the document types from the original instance and then use the package manager in the "Developer" section to package everything else up so you can import it in the new instance. However you should be aware that adding images to packages is not possible out of the box unless you use a "package action script".

    Perhaps creating the package is not the proper approach if the site is image heavy - Then it might be worth exploring the option to either use uSync/usync content or uMport to map the data between the two instances. A 3rd option is to use the CMSImport package to import the content. Be aware that it's a commercial package though (Not document types etc. - just content).

    I hope this is useful.

    /Jan

  • Alex 30 posts 120 karma points
    Feb 01, 2015 @ 21:04
    Alex
    0

    Thank you for the reply Jan,

    as I thought it looks a bit dangerous, and I am on a tight deadline. I will have to postpone that until a later stage I think.

    Cheers.

Please Sign in or register to post replies

Write your reply to:

Draft