Copied to clipboard

Flag this post as spam?

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


  • Lucas Kwasnik 8 posts 78 karma points
    May 18, 2016 @ 00:52
    Lucas Kwasnik
    0

    Change doctype of bulk nodes after upgrade

    I am upgrading an Umbraco version 6.0.5 to the current latest version 7.4.3. I have an old blog package on this site and want to upgrade it to a new blog tool. I have hundreds of Blog posts that will need to be moved to this new blog tool.

    Will I need to move all the nodes and then update their doctypes one-by-one, or is there a tool that will allow me to update the doctypes of all these nodes in bulk?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 18, 2016 @ 06:13
    Jan Skovgaard
    0

    Hi Lucas

    Perhaps you should have a look at the CMSimport package, which you can find here http://soetemansoftware.nl/cmsimport - It allows you to easily import content from various different sources.

    So if you're able to export the blog content in any of the listed formats you should be able to rather quickly import and map them to your new structure. But be a aware that it's a commercial package - First 500 imports are free though.

    I think this is perhaps the best fit in this scenario - Not sure whether uSync can be of use too though.

    Just my 2 cents :)

    Hope it's of any use.

    /Jan

  • Lucas Kwasnik 8 posts 78 karma points
    May 18, 2016 @ 16:27
    Lucas Kwasnik
    0

    Thanks Jan, I have used CMSImport before for other purposes, but hadn't thought of exporting the content first in order to import it.

    However, won't this just create all new nodes with the imported content? I was hoping to keep the Node IDs intact as they are now for all Content nodes and also wanted to keep all version history for all nodes intact. I think I will lose that version history doing it this way, won't I?

    Thanks for your suggestion.

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    May 18, 2016 @ 16:43
    Nicholas Westby
    0

    Looks like you can do this programmatically using the ChangeContentType function: https://our.umbraco.org/forum/developers/api-questions/59280-How-to-change-DocumentType-programmatically

    It also looks like you'll have to republish all the nodes to be sure the change takes effect.

  • Lucas Kwasnik 8 posts 78 karma points
    May 18, 2016 @ 18:42
    Lucas Kwasnik
    0

    Thanks Nicholas,

    It looks like that solution only works when the properties match exactly, right? The properties in my doctypes are not all the same.

    Is there some property mapping I could do within that foreach loop?

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    May 18, 2016 @ 19:45
    Nicholas Westby
    1

    I'd do what the Umbraco core does: https://github.com/umbraco/Umbraco-CMS/blob/75c2b07ad3a093b5b65b6ebd45697687c062f62a/src/Umbraco.Web.UI/umbraco/dialogs/ChangeDocType.aspx.cs#L241

    Basically, you store a mapping of old/new properties, call ChangeContentType, then set the values of those properties (based on the mappings you stored), and finally save (or publish) the content node.

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    May 19, 2016 @ 07:29
    Richard Soeteman
    1

    Hi Lucas,

    I have this hi on the feature list for Bulkmanager http://soetemansoftware.nl/bulkmanager (yet another commercial plugin from the maker of cmsimport ;-) ) . Can re-schedule some things and work on this next week, will that be on time for you?

    Best,

    Richard

  • Lucas Kwasnik 8 posts 78 karma points
    May 19, 2016 @ 16:42
    Lucas Kwasnik
    0

    Wow, Richard, that would be awesome.

    I still have a coupe weeks before I actually start trying anything with this. Still in the estimating phase.

    Thanks a lot for offering that.

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    May 26, 2016 @ 12:42
    Richard Soeteman
    0

    Hi Lucas,

    It is working already. Bit more testing before release but all looks good :)

    Cheers,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft