Once you have configured the attachment table correctly, you can configure the migration of attachments into the Options tab of the parent form mapping.
On the options tab, select the Attachment Migration Option 'Attachments from URL'. Additional configuration options will then be displayed.
Note that for a BMC Remedy target, the Attachment Migration Option will instead be 'Attachments from URL fill Selected Attachment Fields' and you will also need to select the target attachment fields to populate. See Migrating Attachments into a BMC Remedy Server for more details.
The CSV Attachment Source options identify the source forms (representing csv files) and fields (representing columns on the csv files) that will provide the attachment metadata used in migrating attachments. These will be set to default values, provided the default forms/fields exist, otherwise they will need to be selected based on the csv file being used to provide the attachment metadata.
If configured correctly, any attachments for the records migrated should now be downloaded and attached to the target record when the project executes. Note that attachments will not be migrated for those records that reported an error. The configuration options are detailed below.
CSV Attachment Configuration Tab
| Option | Description |
| Attachment Form |
This is the identifier of the source form, representing the CSV file, that contains the attachment records (including the URL to use for downloading the attachment) Default is attachments |
| Parent Form ID Field |
This is the field on the Source Form that uniquely identifies the record. Default is id |
| Authentication Method |
This option is used to configure authentication when downloading the attachment from a URL. Basic and Token based authentication is currently supported, as well as a specific use case for Attachment URLs referencing a Manage Engine server. If basic authentication is selected, you will need to enter a username/password to be used to authenticate the attached download request in the Attachment Execution Options Likewise, if Token based authentication is selected, you will need to enter the token details in the Attachment Execution Options See the article Manage Engine Authentication for Attachment Migration for more information on this specific use case. Footprints authentication methods applies to the Database source use case only. |
Configure Attachment Table Fields Tab
| Option | Description |
| Parent ID |
This is the identifier of field on the Attachment Form that identifies which parent record the attachment belongs to. Default is parent_id |
| Content URL |
This is the field on the Attachment Form that holds the full URL used to download the attachment file. This configuration option is mandatory, unless the Content Path format is defined on the Advanced tab, and the content path format does does not include a marker for the content path. Default is content_url |
| File Name |
This is the field on the Attachment Form that holds the file name of the attachment. This configuration option is mandatory. The default is file_name |
| Content Type |
This is the field on the Attachment Form that holds the mime content type of the attachment file. This configuration option is optional. If not defined, Precision Bridge will use the extension of the file name to identify the content type. The default is content_type |
| Size |
This is the field on the Attachment Form that holds the size (in bytes) of the attachment file. This configuration option is optional. If not defined, Precision Bridge will not be able to replace existing attachments of the same name but different size when performing 'update' migrations. Precision Bridge will also be unable to perform a check when the attachment has been downloaded to see if it has the correct number of bytes (an incorrect number of bytes may indicate a download error). The default is size. |
Advanced Tab
These advanced options may be used if the content url for download needs to be build the file name needs to be extracted from a longer string. In many cases, these options will not be required.
| Option | Description |
| Content Path Format |
This can be used to construct the content path (file path or url) from where the attachment content can be downloaded. It may use one of several markers, delimited by square brackets to identify values that should be inserted at execution time. The supported markers are: [content-path_url_encoded] - same as for [content_path] but the value will be URL encoded to be suitable to be used as a URL parameter value [file_name] will be replaced at execution time by the value for the defined file_name field. Note that any File Name regex expression defined will be applied first. [file_name_url_encoded] - same as for [file_name] but the value will be URL encoded to be suitable to be used as a URL parameter value. |
| File Name Format |
This string can be used to construct the final file name (including extension) from the value provided from the configured File Name field. If no file name field has been configured, it can give the full attachment filename value - note that this will be the same for all migrated attachments. 2 markers can be used in the format: [file_name] will be replaced with the extracted source file name. If a Regex for the file name has been defined, this is applied first. [ext] will be replaced with the extension calculated from the file mime type. Note that if the mime type is not extracted from the source attachment record, it will be calculated based on the downloaded content, and the appropriate extension applied. In ServiceNow, where the attachment is to be attached as an image, enter the name of the image field here. |
| File Name Regex | This can be used to extract the actual file name from a longer string (e.g. a URL) The value must be a valid regex string with at least one group defined. The value extracted will be that for group 1 of the match. |
| Filter Condition | This does not apply to CSV source attachment migration. |
Attachment Migration at Execution Time
Precision Bridge will process the attachments as follows:
- Get the identifier for the parent record (using the Parent Form ID Field to identify the id column).
- Get all attachment records where the value for the parent table column matches the source form name and the value for the parent id column matches the identifier retrieved above.
- Calculate the file name using the value of the file name field (if configured), the File Name Regex and the File Name format. Note that is the [ext] marker was used in the format, this will not be applied yet.
- Download these attachments (unless they are larger than the configured maximum attachment size, or already exist on the target with the same filename and size) If an authentication method has been selected, authentication will be applied to the download request.
- If the mime type has not been identified yet, get it from the attachment content. If the [ext] format marker has been used, replace it with a extension for this mime type.
- Upload the attachments to the target.
Errors or Warnings will be reported if:
- Error: The download fails due to an invalid URL or invalid/missing authentication
- Error: The Upload to the target fails
- Error: The attachment is larger than the configured maximum attachment size (see Defining Attachment Options)
- Warning: The downloaded attachment size is different to the size declared in the CSV file.
Note that Attachment migration can typically take a significant time.
Related Articles:
CSV To Service Now Attachment Migration - Overview
Manage Engine Authentication for Attachment Migration
Comments
0 comments
Please sign in to leave a comment.