Knowledgebase: Index related
How to add new metadata to archived files
Posted by Andre Kuehnemund, Last modified by Andre Kuehnemund on 26 November 2018 15:11

It is possible to retroactively add metadata to archived files in the index database. The following is an example of how this can be done.:

- My existing 'Default-Archive' index database already contained the default 'description' and a custom 'user_author' metadata fields.

- I created three new ones: 'user_color', 'user_year' & 'user_country'.

- Please note that when you create custom metadata fields, you will need to enter them as 'color', 'year' & 'country'. P5 will then prefix them in the database with 'user_'.

- Next, I archived a folder called '/Users/Shared/NAB_2016/'. That folder contained a handful of JPGs. One of those files was 'P1100701.JPG'.


- In a Terminal window, I executed the following command:

mbp-aw:bin admin$ ./nsdchat -c ArchiveEntry handle localhost /Users/Shared/NAB_2016/P1100701.JPG

- The P5 CLI returned the archive handle for that file:


- Next, I executed the following command:

mbp-aw:bin admin$ ./nsdchat -c ArchiveEntry Default-Archive#L1VzZXJzL1NoYXJlZC9OQUJfMjAxNi9QMTEwMDcwMS5KUEc= setmeta user_color RED user_year 2016 user_country Deutschland

- This time, the P5 CLI returned the name of each custom field along with its newly added contents.:

user_color RED user_year 2016 user_country Deutschland

Afterwards, I was able to view the newly added metadata in the restore browser.

I realize that this was done with just a single file. Getting the paths and then the handles for a larger number of archived file may be a bit more complicated. However, there are two CLI commands that may help with that:

- "ArchiveIndex <name> inventory <output file> [<options>]"


- "Job <name> inventory <output file> [<options>]"

Someone who is good at scripting could probably write a script that first creates a list of all archived files contained in an archive index, or a list of archived files for a particular job (depending on which one of the two commands is being used), then starts a loop that gets the archive handle for each file, then adds the new metadata for each file using the 'setmeta' command in conjunction with the archive handle.

For more information on the various P5 CLI commands mentioned in this article, please refer to the P5 CLI manual available here:

(2 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).