Attachment migration

Attachments are documents that are linked to an instance of an object. A document can be attached to a given user, a given item, a given sales orders, etc. For example: the table AOBJTXT stores the link between the key of the instance ( (ITM,CD100) for the item CD100) and the path (C:\documents_items\my_item_CD100.docx).

Changes in attachment management

In version 9, the attachment management has been changed to use volumes. For every file, the path of an attachment is now expressed with the following mandatory syntax:

[VOL]/path

Where VOL is a volume name, and path is the path of the file in a volume.

Previously, the 'path' could be directly expressed as a windows or unix path:

You must replace all the operating system paths with a normalized path based on a volume to re-link the documents. This change applies to all the paths stored in the attachment table (AOBJTXT).

The recodification tool was created to help with this process.

What does the tool do?

This tool performs the following operations:

Additional operations

When replacing the path, you can adjust the way the path is created.

Grouping paths

If, for example, you want to regroup several paths, you can map them to the same volume. For example, the system finds two "old" attachments, C:\documents\old\myold_doc.docx, C:\contracts\2003\distribution.docx. If no volumes exist for them, the system suggests creating two volumes: one assigned to C:\documents\old\, the other to C:\contracts\2003\. Instead, you can choose to assign the first path to a volume called [olddoc], and assign the second path to a volume of the same name.

Warning: Using this tool creates a volume olddoc assigned to one of the paths, and just renames the second document in the attachment table. However, the second document will not be moved to the first location; you need to do this manually.

Using shorter paths

If, for example, you have documents in directories that are C:documents\mails\2013\, C:documents\mails\2014\, C:documents\mails\2015\... The system suggests creating three directories, which are, by default, the longest paths possible. But if you create a unique directory C:documents\mails\ called [mails], the path of the different documents will be defined as [mails]/2015/mail1.doc, [mails]/2013/mail25.doc... In this case, you do not need to move the documents.

Redefining paths

For local documents (#@C:\path), you need to redefine a volume and manually move the documents to the corresponding volume path from every local PC.

How to use the tool

When the tool is launched the first time, it runs a check on the attachment tables. When this analysis is done, a screen with two grids displays:

Files

This first grid lists the results of the analysis in the AOBJTXT analysis:

The total number of attachments is displayed at the bottom of the grid.

Clicking the Detail link on the line next to a result creates a log that gives you details on all corresponding results. The log file is displayed on a separate page.

Volumes

This second grid allows you to define actions for each result. In this grid, two kinds of lines are present:

In summary, you have the following choices:
* Enter Yes for 'Create' (modification will then be set to No), and use the existing path or modify it.
* Enter No for 'Create' and Yes to 'Modify'. Enter an existing volume name to assign the files to the corresponding volume.
* Enter No to 'Create' and 'Modify' if nothing no action will take place in the corresponding run.

Click the Validation link to run the creations and modifications.

Operations present in the right panel

The following links are available in the right panel:

Renaming strategies

When creating modules, it could be helpful to find the right balance between the number of files and the number of volumes. For example, if you have the following volumes:

C:\Contracts\Distribution\2011 : 218 documents

C:\Contracts\Distribution\2012 : 524 documents

C:\Contracts\Distribution\2013 : 200 documents

C:\Contracts\Distribution\2014 : 753 documents

C:\Contracts\Distribution\2015 : 26 documents

C:\Contracts\Patents\2012 : 252 documents

C:\Contracts\Patents\2015 : 15 documents

C:\Contracts\Others : 46 documents

C:\Contracts\Advertisement : 18 documents

You can create one volume per year for every distribution contract directory, e.g., [DIS11], [DIS12], [DIS13], [DIS14], [DIS15], and then a volume for all patents, and finally a volume for all the other documents. In this scenario, you need to work in several passes and recodify the longest path first.

The recodification page looks like the following:

First:
* Recodify the local path as [LOCAL]/path (the LOCAL volume has been created directly).
* Create the DIS11 to DIS15 volumes and recodify the corresponding files.
* Create the PATENTS volume and recodify the files starting with C:\Contracts\Patents (this also handles the 15 files present on C:\Patent\2015 although No action has been required on them because a path that matches the beginning of the path exists).

After running, 64 files remain (C:\Contracts\Others and C:\Contracts\Advertisements), and the page looks like this:

You can now start a second pass that renames all the remaining files starting with C:\Contracts. The first pass migrated all the other files, which is why it was important to recodify the longest paths first.