Target Audience: This article is targeted at system administrator who are comfortable with command line tools. If you are not please ask your system administrator to help you upload bulk metadata in Zoom.
Zoom supports import of assets as well as metadata using the command line interface. This will allow you to import either assets with metadata applied to individual files or just the metadata after the assets have been imported.
Steps to importing bulk metadata:
- Create a comma separated value list (CSV) or a TAB delimited metadata file as described in the section below. You can download a sample metadata CSV file
md.csvfile that we use in the example below.
- This is the Directory where we are running the command from :
To create the metadata file please review this article that explains the file schema used to specify the metadata Zoom can parse. The
UIDcolumn in the metadata file specified the unique identifier that is required to match the asset in Zoom and apply the metadata to. The
UIDis the fully qualified file name in Zoom or it’s a relative path to the
-d diroption specified with the
- CSV can use UNIX style line endings ‘\n’ (newline or LF) or Windows style line endings, ‘\r\n’ (CRLF), but cannot have UTF-8 BOM (see tips below on how get rid of it)
- Next execute the zm import command to bulk import the metadata. For example:
zm -s http://192.168.56.102:8880 import -csv -m "metadata migration" -d /Library -om -mf md.csv
Here is the breakdown of the zm Import command:
s the server you are importing the asset metadata to csv this tells the import tool to use the metadata file as a CSV, otherwise by default its setup to use TAB delimited file d The assets paths inside the metadata file are relative to this destination folder on the Zoom repository mf metadata file path (in this example the command is being run in the folder where the metadata file resides) m comment for the metadata import, this is a required om Import only the metadata supplied in the input file, no asset files are to be imported df Advanced option: Format specifier for all date entries in the metadata being imported. For example, “MM/dd/yy” indicates the US locale standard format of month/day/year (two digits each)
- Once the command returns successfully, you can verify the applied metadata using the Zoom Asset Browser tool.
Tips & Tricks
Updating existing metadata
If you wish to bulk update existing metadata of files already ingested in Zoom, then head over to the Zoom Asset Browser (VAB) and Export metadata on the selected assets via VAB > Cart > Export Metadata:
Open the generated CSV file and delete columns:
- Asset ID
- FIPR or
- system generated metadata fields based columns
You should end up with just the columns you wish to update in the CSV file, for example in the zm-metadata.csv:
Using absolute paths in UID
As shown in the above Excel screenshot, if your UID starts with a slash ‘/’ that means you wish to use absolute UID to update the metadata in Zoom. In that case please ensure you specify the root folder in the -d arg to the import command:
zm -s https://myzoomserver:9880 import -csv -m "bulk metadata migration" -d /-om -mf zm-metadata.csv
UTF-8 BOM and Line Endings
The CSV can use UNIX style line endings, ‘\n’ (newline or LF) or Windows style line endings, ‘\r\n’ (CRLF). If you are using Microsoft Excel to export the CSV please don’t save as CSV UTF-8 as that adds the UTF-8 BOM.
In case you need to test BOM and the line endings on a shell, use a tool like od for e.g. on MacOS Terminal app:
$ od -c zm-metadata.csv
To remove the BOM from the first line of a file you can use something like:
$ sed -e '1 s/^.//' md.csv > clean-md.csv
Help with import command
Since we constantly are adding new features, it’s helpful to get the current usage help for the zm import command:
$ zm help import import [-nrec|--non-recursive] -m|--message v [--message-file v] [-t|--type v] [-e|--charset v] [-d|--dest-dir v] [-p|--project v] [--modifier v] [-b|--branch v] [-f|--force] [-mrr|--multipleRowsPerRecord] [-om|--onlyMeta] [-csv] [-mf|--metafile v] [-kws|--keywordstock] [-dup|--on-duplicate v] [-df|--dateFormat v] [-spd|--srcParentDir v] [--usetb] [-ep|--extractPath v] [-bmd|--blanketMD v] [-fet|--fileExistsInTPM v] [infiles] [--checkFqPath] [-cid|--collectionId v] [-uemd|--useExistingMDForMan] [--override-c3 v] [-it|--ingesttype v] [-stc|--skipTPMCopy] The command supports the following options: -nrec|--non-recursive Do not descend into sub-directories. -m|--message v Specify a log message or comment that would be associated with this changeset. --message-file v Specify a path to a file that contains the log message. -t|--type v Override file type detection and use the specified type. -e|--charset v Override the charset detection and use the specified charset -d|--dest-dir v The destination path where the files need to be imported. -p|--project v Specify a project name. --modifier v Specify a valid file modifier, see user guide .....