Copied to clipboard

Flag this post as spam?

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


  • Alex Brown 129 posts 620 karma points
    Jan 31, 2017 @ 07:50
    Alex Brown
    0

    Transfer Media Between Environments with Custom Sections

    Hi all I'm using Umbraco 7.3.

    I've got a site which needs migrating/merging into another site. I've got Courier which transfers all content, so that's all well and good.

    The problem arises whereby I have custom sections which use custom database tables. I know that Courier doesn't transfer custom sections, only content.

    The purpose of these tables are to display products, and each product is assigned one or more images (from the media folder), the link between the media and products is stored in the custom tables.

    When I use Courier to transfer all media, each media item will change it's id, as the site which is receiving this import also has its own media.

    So my question are:

    1. Is there a way to transfer the media across whilst keeping the ids the same?
    2. Is there a way I can get the media folder id from the database? (I may be able to write a script involving this during the transfer)
    3. Would anyone suggest a better method for this transfer?

    I appreciate any comments, thanks!

  • David Peck 687 posts 1863 karma points c-trib
    Jan 31, 2017 @ 09:16
    David Peck
    0

    Hi Alex,

    Id's such. Courier will change them and then you have a problem.

    I'm not sure why you'd want the media folder id, but I think that should just be IContent.ParentId. You'll be using the ContentService I presume. https://our.umbraco.org/documentation/reference/management/services/contentservice

    Best solution I can think of is to use the Guid that is assigned to each item (IContent.Key) rather than the Id. There might be a smarter solution, but I'd probably try to resolve this with a SQL query after you've migrated your data.

  • Alex Brown 129 posts 620 karma points
    Jan 31, 2017 @ 09:21
    Alex Brown
    0

    Thanks for the reply David. So, would the Guid not change when Courier migrates?

  • Alex Brown 129 posts 620 karma points
    Feb 03, 2017 @ 08:41
    Alex Brown
    0

    I've seen that the Guid does not change. However, when I use courier to transfer media, it is not shown in the cmsContentXml table in the database, however it does appear in the media folder within the CMS.

    I've seen people say that the *Umbraco/dialogs/republish.aspx?xml=true * url will refresh the database, however my media is still not appearing in the table. It seems to be sitting in XML (from my guess).

    Also, the media only seems to be inserted into the database upon me clicking the "save" button on the media item's node.

Please Sign in or register to post replies

Write your reply to:

Draft