Transfer

The Transfer module enables transmission of content data from one server to another.  It provides a receiving service at /lynicon/transfer/receive, to which data is POSTed, using Basic Authorization.  The server to which data is transmitted, and the username/password used to transmit or receive are set up in web.config.

The transmission is an HTTP request with a JSON body of the serialized container of the content.  Consequently it is possible to transmit a container between servers set up with different versioning. If a version key exists on the transmitter but not the receiver, this will work fine in itself, but you must ensure only the content with one specific versioning key value can be sent from the transmitter, or you may send different versions of the same content to the receiver. If a version key exists on the receiver but not the transmitter, the created content item on the receiver will simply have the default value of the version.

Setting up the transfer module

The transfer module requires adding the Transferred (date transferred) and UserTransferred fields to the ContentItems table. This can be done by running the script at /Areas/Lynicon.Base/Admin/SQL/TransferInit.sql.

Configuring the transfer module

The Transfer has the following settings:

  • TransferType: this function from a Type to a bool returns true for a content type which is possible to transfer
  • AutoTransferType: this function from a Type to a bool returns true for any content type which should be automatically transferred along with any manual transfer if its update date is later than its last transferred date
  • TransferrablePartialVersion: this abstract ItemVersion must contain the ItemVersion of a content item for that item to be possible to transfer.  This can be used for instance to avoid unpublished content being transferred.

There are also keys to be set in web.config in the appSettings element:

  • TransferUsername: the basic config username to secure the transmission
  • TransferPassword: the basic config password to secure the transmission
  • TransferTargetUrl: the full url to which the transfer is transmitted, this will end /lynicon/transfer/receive.
  • BaUsername: the basic config username for receiving transmissions
  • BaPassword: the basic config password for receiving transmissions

Ensuring a content type can be transferred

A content type can be transferred if:

  • Its container type implements ITransferable
  • When input to the TransferType function, the content type returns true.

Using the transfer module

Items can be transferred by selecting them on the Filter page.  When the Transfer module is installed, it creates a button 'Transfer' on this page in the Results Operations area which will transfer the selected content items.

Also on the Filter page, you will see the Transfer module has created a custom filter.  There are checkboxes for 'Never Transferred' and 'Req Transfer' which show items which have never been transferred or which have been updated since they were transferred (or either if both checked). This is intended to assist in finding items which require to be transferred.