Copied to clipboard

Flag this post as spam?

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


  • Frank McKenna 6 posts 77 karma points
    May 23, 2021 @ 12:21
    Frank McKenna
    1

    uSyncActions.config file not capturing Node deletion(s)

    Hello.

    Firstly, thanks to Kevin Jump/everyone working on uSync for a very useful package.

    We're encountering an issue with Node deletions being captured by uSync and are wondering if anyone can offer advice, please?

    We have the following setup:

    • Umbraco 7.15.4
    • uSync.BackOffice 4.0.5.0
    • uSync.Core 6.0.7.0
    • uSync.Content: 4.1.3.0

    Looking at the uSync documentation, it states "When you delete an item, an entry is made into the uSyncActions.config file that tracks deletes. This file is used during an import, to process the delete on other Umbraco instances.”

    Our Issue

    However, whenever we delete nodes in the backoffice, no entries appear in the "uSync/data/uSyncActions.config" file.

    I have checked the settings in our "uSyncBackOffice.config" file against the documentation which states this is controlled by the "Export on Save/Delete" entry in the config:

    <ExportOnSave>true</ExportOnSave>
    

    Unfortunately, I cannot see any additions to "uSync/data/uSyncActions.config" (or any other file generated at all) upon Node deletions.

    A search did find the following issue on GitHub: [Deleting content should (optionally) add actions to the action file][1], however I don't think this applies as it was fixed in the "v4.04 patch release"?

    I think this may be a missing setting/configuration issue but can't see what this could be.

    If anyone has experience/opinions on this issue I would appreciate your thoughts.

    Thanks in advance.

  • Marc Goodson 1626 posts 10769 karma points MVP 6x c-trib
    May 24, 2021 @ 06:08
    Marc Goodson
    1

    Hi Frank

    The uSyncActions.config file, I think, is only for tracking deletes of structure eg 'Document Types' and 'Data Types' in the core uSync version, rather than being used in the Content Edition to track deletes to content.

    With uSyncContentEdition, when you delete a node, it should still have a corresponding text file on disk matching where it was in the content structure in the uSync Content folder - but this file will not have the original content - then when you move the blank file to the target environment, that's how uSync knows it should delete the particular content item there during import.

    regards

    marc

  • Frank McKenna 6 posts 77 karma points
    May 24, 2021 @ 07:58
    Frank McKenna
    0

    Hello Marc and thank you for the quick reply.

    I have applied this as quick test this morning:

    In the Umbraco Back Office

    • Created a Node "deletionTest"
    • This created a folder and file: "/uSync/Data/site name/deletionTest/content.config"

    • Deleted the Node "deletionTest"

    • This deleted the file: "/uSync/Data/site name/deletionTest/content.config"
    • However, the Folder "/uSync/Data/site name/deletionTest/" remains

    Searching my filesystem, I don't see a corresponding text file on disk - from what we're discussing I am expecting to see a text file (without original content) at "/uSync/Data/site name/deletionTest/content.config".

    I wonder if you could offer any advice as to whether this could be related to a configuration setting in the "uSyncBackOffice.Config" file?

    I have seen forum posts mentioning having to "turn on the tracking of deletes in the usync backoffice configuration file as well", but can't see any config element that handles this in the file, or mentioned in the documentation?

    Again, thank you very much for taking the time to help.

  • Marc Goodson 1626 posts 10769 karma points MVP 6x c-trib
    May 24, 2021 @ 18:25
    Marc Goodson
    1

    Hi Frank

    Hmm, maybe it is the empty folder that is enough?

    What happens if you create a new node, push the usync files to a new environment and do an import (to create the new node in the new environment)

    Then go back to the original environment, and delete the node and push the usync files to the new environment (eg with just the folder, and no file in it) does running the import delete the node on the new environment?

    eg is it the existence of the folder with no file that is the trigger for deletions?

    (sorry it is a while since I played with the content edition)

    regards

    Marc

  • Frank McKenna 6 posts 77 karma points
    May 25, 2021 @ 17:05
    Frank McKenna
    0

    Hello again.

    I have just completed the following test

    • Delete Node "Test" (which exists on my Local and on the DEV environments, in the back office)
    • On Local: a file was generated at "uSync/data/content/site name/test/content.config"
    • This was marked by Visual Code source control as "deleted" (red "D" next to the file)
    • Made a Pull Request for the uSync/data/content/site name/test/content.config*
    • Deployed this to DEV server
    • Logged into DEV back office, which, under the "Developer" section "uSync" has "Auto Sync" enabled
    • Checked "Content" tree - unfortunately the node has not been deleted

    I'm stumped at this point. I have checked the docs, config settings, performed multiple tests and uSync simply does not seem to generate any "empty .config" file.

    I'm wondering, does anyone know if it is possible to contact the lead dev, Kevin Jump, directly?

    If anyone can offer any thoughts, I would appreciate it.

  • Frank McKenna 6 posts 77 karma points
    May 25, 2021 @ 07:10
    Frank McKenna
    0

    Hello Marc.

    That's a good point, which also occurred to me after noticing the folder was left behind on a deletion.

    However I'm slightly confused as I read a comment by Kevin Jump in Some content gets deleted when running full import in which he states:

    "When you delete anything while you have uSync installed it will write an 'empty' .config file in the place where the config file for the item you are deleting use to be, these 'empty' files tell uSync what items need deleting when an import is run."

    I will test your suggestion and see if this works. Your help is much appreciated, thanks.

    Hope you have a great day.

  • Kevin Jump 1996 posts 12598 karma points MVP 5x c-trib
    Jun 21, 2021 @ 14:09
    Kevin Jump
    2

    Hi,

    yeah - sorry the documentation isn't super clear for this version.

    for Content and Media on v4 of uSync - deletes will not be marked unless the handlers settings to turn on deletes has been set:

    that is

    <HandlerConfig Name="uSync: ContentHandler" Enabled="true">
      <Setting Key="deleteactions" Value="true" />
    </HandlerConfig>
    

    and for media

    <HandlerConfig Name="uSync: MediaHandler" Enabled="true">
      <Setting Key="deleteactions" Value="true" />
    </HandlerConfig>
    

    with these settings on the deletes will go into the uSyncActions.config file..

    For the blank file behaviour and v4 you need to have PreserveAllFiles set to true in the uSyncBackOffice.Config file

    <PreserveAllFiles>false</PreserveAllFiles>
    

    for uSync 4 - this will write a 'blank' file in place of any file you delete - As not all deployment methods delete files from the target site - this stops old files from causing content or items to be accedently recreated when a sync occurs.

    in v8 - this has changed - there is no longer a usyncactions.config file, and the 'blank' files now contain the command (e.g delete or rename) that uSync should do, so in many ways its much simpler and a bit more robust - as we don't have to worry about all of these files just the 'empty' ones.

  • Frank McKenna 6 posts 77 karma points
    Oct 21, 2021 @ 07:41
    Frank McKenna
    0

    I thought I had replied to this response at the time, just noticed this was missed.

    The approach that worked for us

    1. Update the "/config/uSyncBackOffice.config" file to add "HandlerConfig" elements for "Content" and "Media"

    enter image description here

    1. In the Development site Back Office, delete an existing NODE - this will add an entry to the "/uSync/data/uSyncActions.config" file

      enter image description here

    2. Source control these files and deploy to the target site

    Many thanks to everyone who took the time to respond, particularly Kevin Jump. Your help is appreciated.

  • Phung Dao 7 posts 87 karma points
    Oct 26, 2021 @ 03:12
    Phung Dao
    0

    Hi Frank,

    Is it possible to see your entire uSyncBackOffice.config file?

    I tried adding the handler config but something must be wrong since it keeps deleting everything on IIS restart.

    Currently, what I have:

      <Import>true</Import>
      <ExportAtStartup>false</ExportAtStartup>
      <ExportOnSave>true</ExportOnSave>
      <WatchForFileChanges>false</WatchForFileChanges>
      <ArchiveVersions>false</ArchiveVersions>
      <Folder>~/uSync/data/</Folder>
      <ArchiveFolder>~/uSync/Archive/</ArchiveFolder>
      <BackupFolder>~/uSync/Backup/</BackupFolder>
      <MaxArchiveVersionCount>0</MaxArchiveVersionCount>
      <DontThrowErrors>false</DontThrowErrors>
      <UseShortIdNames>false</UseShortIdNames>
      <PreserveAllFiles>false</PreserveAllFiles>
      <HandlerGroup>default</HandlerGroup>
      <Handlers Group="default" EnableMissing="true">
        <HandlerConfig Name="uSync: DataTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: TemplateHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: ContentTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MediaTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: LanguageHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: DictionaryHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MacroHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: DataTypeMappingHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MemberTypeHandler" Enabled="false" Actions="All" />
        <HandlerConfig Name="uSync: ContentHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MediaHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: ContentTemplateHandler" Enabled="false" Actions="All" />
      </Handlers>
      <Handlers Group="Deploy" EnableMissing="false">
        <HandlerConfig Name="Deploy:DataTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:TemplateHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:ContentTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:MediaTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:LanguageHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:DictionaryHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:MacroHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="Deploy:MemberTypeHandler" Enabled="true" Actions="All" />
      </Handlers>
    </uSyncBackOfficeSettings>
    

    I've tried adding it in like this

      <Handlers Group="default" EnableMissing="true">
        <HandlerConfig Name="uSync: DataTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: TemplateHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: ContentTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MediaTypeHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: LanguageHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: DictionaryHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MacroHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: DataTypeMappingHandler" Enabled="true" Actions="All" />
        <HandlerConfig Name="uSync: MemberTypeHandler" Enabled="false" Actions="All" />
        <HandlerConfig Name="uSync: ContentHandler" Enabled="true" Actions="All" />
             <Setting Key="deleteactions" Value="true" />
        </HandlerConfig>
        <HandlerConfig Name="uSync: MediaHandler" Enabled="true" Actions="All" />
         <Setting Key="deleteactions" Value="true" />
        </HandlerConfig>
        <HandlerConfig Name="uSync: ContentTemplateHandler" Enabled="false" Actions="All" />
      </Handlers>
    

    as well as removing on each of them but they all wipe on restart. Not sure if i'm typing in the configurations correctly.

    Thank you

  • Phung Dao 7 posts 87 karma points
    Oct 29, 2021 @ 00:51
    Phung Dao
    0

    Nvm hehe copying config directly from documentation worked for me

    https://usync.readthedocs.io/handler-config/

  • Frank McKenna 6 posts 77 karma points
    Oct 29, 2021 @ 07:13
    Frank McKenna
    0

    Hello Phung, apologies for the late response - busy week here and I missed this.

    The only changes made were outlined in my previous post, otherwise these files are the same as the "default".

    Glad you got this working!

    Best regards.

Please Sign in or register to post replies

Write your reply to:

Draft