Updating existing assets in bundled/XML import


(Al King) #1

Hi folks,

I’m interested in simplifying a monthly routine using a bulk import of some kind. Each month, a user manually updates a series of file assets by acquiring locks, uploading the new version and committing.

I can see that, for example, the “Import Assets from XML Tool” accepts a tar file with file resources and XML instructions. Hypothetically, if our monthly files to update were a single bundle with XML instructions, we could update all the files “in one go”. However, the default instructions generated on an export look as though they would add new assets to the tree, rather than updating preexisting ones.

Is there a way to use this XML importer, or similar tool, to achieve essentially the same effect as the one-by-one manual process described - i.e. preserving the original asset IDs, updating the file, and keeping an accurate version history?


(Harinder Singh) #2

@mfong might be able to anwser this.


(David Schoen) #3

If you export one of the files you’re interested in updating you will get a bunch of actions. Just keep the actions you want and replace the variable ids like <asset>[[output://create_File_5729.assetid]]</asset> with an actual assetid e.g <asset>5729</asset>.


(Al King) #4

Hi David,

Thanks - the main thing I need to be able to do is a file upload to a preexisting asset ID. The upload seems to happen in the ‘create_file_asset’ step, where only a “parentid” tag is present in the example export I have. This to me suggests that I can only create new leaf assets branching off from a parent node that way, rather than an in-place update per the example manual process (but maybe there are variant ways of calling this action that aren’t obvious from a default export?).

I may have an inaccurate mental model of how Squiz assets work here - I’d play around a bit but I’m not owner of this server, just editor of a subsite, so I don’t want to guess too much and mess with things.