Copied to clipboard

Flag this post as spam?

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


  • Sotiris Filippidis 286 posts 1501 karma points
    Oct 09, 2022 @ 21:19
    Sotiris Filippidis
    0

    Migration plans with package.xml and updating existing data in target umbraco site

    I've been playing with automatic and custom migration plans (v. 9.5.4 for the time being) and I am struggling to find a way to make the migration update existing items on the target umbraco site.

    New items are created with each update, but existing items (e.g. changes in doctypes or views included in the package.xml file) are not passing through.

    What could I possibly be doing wrong? Is there a way to re-run the whole migration plan based on a package.xml file and update everything?

  • Kevin Jump 2343 posts 14890 karma points MVP 8x c-trib
    Oct 10, 2022 @ 08:19
    Kevin Jump
    101

    Hi,

    On the whole, the package systems is only additive (so it will only add new things).

    If things are already created, they get left, I think it will add new properties to existing things but i am not 100% sure.

    uSync and Umbraco.Deploy sync things so they will update existing items. In theory it is possible to run uSync in a package migration, but it would take a bit of code to achieved.

  • Islam Khattab 1 post 71 karma points
    Jul 11, 2024 @ 16:42
    Islam Khattab
    0

    Thanks, Kevin!

    For anyone who would come across this issue, We had combined Creating custom package migration approach along with the awesome uSync package, specifically the uSync.Backoffice package, so basically as a package composer we opted into serializing the package related items into a specific location and run uSync import api on the migrate method, you can define your own safeguards and conditions when to run or skip the migration but this is the basic idea

    https://gist.github.com/islamkhattab/70d6f9399db92c7c7537fed302caa8d0

  • Sotiris Filippidis 286 posts 1501 karma points
    Oct 10, 2022 @ 09:06
    Sotiris Filippidis
    0

    Thanks Kevin, it's nice to know I'm not crazy :)

    The irony is that I had created nuget packages that would set up views via targets, and I ditched them in favor of the xml package thinking that it would update stuff (when ran via a custom migration plan).

    So apart from uSync, I guess the only other alternative is pure code in order to update stuff, right? Should I dare ask whether there is some code generation tool for that somewhere? :)

Please Sign in or register to post replies

Write your reply to:

Draft