Please enable JavaScript to view this site.

Navigation: The Cobwebb Web Server > Configuring Docstore

Moving Document Type Storage Location

Scroll Prev Top Next More

Disclaimer

Please read this topic fully before making any changes. Ensure that all prerequisites are fully tested, such as the QNTC file system (if used) and read/write folder access from the IBM i, User ID etc., before starting this procedure. Please ensure the procedure is fully understood and plan for the Cobwebb Server system downtime within the business.

It is recommended that this procedure is first fully tested in a ‘testing’ environment which is separate to the production environment.

This procedure is undertaken at your own responsibility and Cobwebb Communications Ltd. cannot accept responsibility for costs, damage or loss of earnings as a result of information contained within this topic or actions taken as a result of reading this topic. Cobwebb Communications Ltd. would be able to provide an estimate for consultation services to complete this procedure if required.

Overview

There are various steps required to move the location for storing documents for a specific Document Type in Docstore. Note: If you need to move all documents in a Docstore, then you will need to repeat this process for all Document Types in that Docstore.

1.Check that you can upload a document to the existing location

2.Create and Share the new storage location

3.Configure Docstore to use the new location for a Document Type

4.Test Access to new location

5.Prepare to move old documents to the new location

6.Update the Docstore database

7.Move the documents and restart the CPPD subsystem

Step 1 - Test Access to existing storage location

Firstly it is a good idea to check that you can upload a test PDF to the current location for the Document Type.

1.Open up a browser and type in the name/ip address of the IBM i followed by :6443 (the Port for HTTPS or :6440 the Port for HTTP) to browse to the Cobwebb Web Server

2.See Upload a Document to a Docstore and upload a test PDF to the Docstore Document Type you wish to change the storage location for.

3.Now you need to check that you can search for and view the document.

a.Click on the Advanced tab then click Search (leave fields blank).

b.The most recent documents are displayed at the top of the screen – check the test PDF file (which has just been uploaded) can be seen and opened for viewing.

4.Do not proceed until this test has been successful.

Step 2 - Create and Share new storage location

1.Create the folder location to be used as the new location for your documents. It is recommended to use a folder path structure similar to:

…/DocStore/<Docstore Name>/<Document Type Name>

2.Share the folder for read/write access for the Document Handling Username (if used) or individual users, to enable them to read / upload / delete documents- see How Docstore Authorisation works for details. It might be a good idea to check the sharing for the current location and replicate for the new location, especially if more than one user requires access.

3.If using the QNTC file system i.e the location is on an external server or storage device, ensure the folder is ‘visible’ from the IBM i . See QNTC Configuration for details.

Step 3 - Configure Docstore to use new storage location

1.Firstly ensure that no documents of the Document Type, whose location is being changed, are being uploaded to Docstore. This includes any scanning software.

2.Browse to the Cobwebb Web Server and log on to Docstore as a Docstore Administrator (you must be able to see the Server Configuration button/link on the Docstore home page).

3.Select Server Configuration then Configure Individual Docstores, select the appropriate Docstore name.

4.Next click on the Document Type whose location is to be changed. The settings for the Document Type are displayed.

a.First note down the existing Document Folder entry as you will need this later when updating the Docstore database.
Document Folder

b.Now enter the path to the new location into the Document Folder entry (including the ‘/QNTC/’ prefix if necessary) e.g.
 
Note: If using QNTC then, if the displayed Directory when using WRKLNK is:

/cppd/DocStore/Cobwebb Store/Invoice

it will need to be entered into Docstore as:

/QNTC/cppd/DocStore/Cobwebb Store/Invoice

c.Enter the Document Handling Username if required.

d.Click Update to apply the changes.

Step 4 - Test Access to new storage location

Now you need to perform a test to check that you can upload a document to the new storage location.

1.Repeat the steps from Step 1 using the new storage location.

2.Do not proceed until this test has been successful.

Note: If necessary, the changes can be reversed, by changing the Document Folder path back to the previous folder path for the Document Type.

Step 5 - Prepare to move old Documents to new storage location

Now that we have tested the new location for the Document Type, ‘old’ documents of the same Document Type can be moved to the new location. Before doing this, we need to glean some configuration information and stop any new documents being uploaded into Docstore.

1.Find out the IBM i library name being used by Docstore for storing database information for the Docstore Document Type.

a.Browse to the Cobwebb Web Server and log on on as a Docstore Administrator.

b.Select Server Configuration then Configure Individual Docstores

c.Select the Docstore name which contains the Document Type whose documents need relocating.

d.Make a note of the name of the IBM i Library used by the Docstore. This is called the Docstore Library e.g.
Docstore Library

2.Next, find out the Document Type Id for the Document Type being moved to the new folder storage location.

a.Browse to the Cobwebb Web Server and select Docstore.

b.Click on the Docstore which contains the documents which need to be moved.

c.Ensure the Advanced tab is displayed then select the relevant Document Type from the drop down list.

d.Leave the other fields blank and click Search to return a list of documents of that particular Document Type.

e.Click on the Information link for the first document and the Cobwebb Docstore Document Metadata information is displayed.

f.Make a note of the Document Type ID under Additional Metadata e.g.
Document Type ID
Note: These values will be required later.

3.End the CPPD subsystem. (Warning: All CPPD and Docstore functionality will be ended)

4.Whilst the CPPD subsystem is ended, ensure that documents are not being inserted into Docstore via any scanning software.

Step 6 - Update the Docstore Database

Docstore keeps a record of where each Docstore document is stored in the Docstore database. The Docstore database record for each document found for the Document Type in question, will therefore need to be updated with the new folder location.

The Docstore database is always stored on the IBM i – no matter where the actual document files (PDF files etc.) are being stored.

The Docstore database file to be updated is called #DOCUMENTS. This is located in the Docstore Library and holds information for ALL documents of all Document Types in the Docstore. Therefore, the file to be updated is <Docstore Library> / #DOCUMENTS e.g.

DOCSTORE01/#DOCUMENTS

The #DOCUMENTS fields required for use in the SQL UPDATE statement are:

The Document Type ID which is called DOCTYPEID (numeric). This field must be used when selecting the records to be updated.

The Docstore Path (Storage file path) file path folder for the documents in Docstore is called DOCPATH (alphanumeric). This is the field to be updated.

List the records to be updated

Using SQL (STRSQL on command line), it is possible to list the documents of the Document Type needing to be updated using the IBM i SQL command:

SELECT * FROM <Docstore Library>/#DOCUMENTS

WHERE DOCTYPEID = <DocTypeID>

AND DOCPATH=’<oldDocPath>’

where <Docstore Library> is the Docstore Library name noted in Step 5 - 1d, <DocTypeId> is the Document Type Id noted in Step 5 - 2f, and <oldDocPath> is the path to your original Document Folder location noted in Step 3 - 4a.

For Example:

SELECT * FROM DOCSTORE01/#DOCUMENTS

WHERE DOCTYPEID = 1

AND DOCPATH=’/cppd/DocStore/DOCSTORE1/DocType1’          

Count the records to be updated

Note: You can retrieve a count of the number of documents that will be affected by running a similar query using COUNT(*)

SELECT COUNT(*) FROM DOCSTORE01/#DOCUMENTS

WHERE DOCTYPEID = 1

AND DOCPATH=’/cppd/DocStore/DOCSTORE1/DocType1’  

Update the Document Path

Now that we have the information required we can use SQL to update the Document Path to the new storage location using the following command:

UPDATE <Docstore Library>/#DOCUMENTS  

SET DOCPATH = '<NewDocPath>'

WHERE DOCTYPEID = <DocTypeID>

AND DOCPATH=’<OldDocPath>’

where <NewDocPath> is the new Document Folder path entered in Step 3 - 4b

For Example: The above example Docstore name could be updated using the following SQL command:

UPDATE DOCSTORE01/#DOCUMENTS  

SET DOCPATH = '/QNTC/HostPCName/DocStore/DOCSTORE1/DocType1'

WHERE DOCTYPEID = 1

AND DOCPATH=’/cppd/DocStore/DOCSTORE1/DocType1’

Step 7 - Move Documents and restart CPPD subsystem

All the existing Docstore files (PDF files etc.) for the Document Type should now be moved from the old location to the new location . The new location must be the same folder as referenced in the SET DOCPATH field of the #DOCUMENTS file in your SQL UPDATE statement.

Restart the CPPD subsystem.