Ins and outs of Outscaling File Synchronization

(Not Related to a Specific Release) - ...

One major task of Outscaling is synchronizing files between (cms) server instances. And that includes not only files referenced within items, but also the items itself rendered as xml using the RAW channel as part of synchronizing contents.

Besides these file synchronizations which takes place automatically, you can also use the Synchronize Files action from the Outscaling menu within the cms manager to e.g. synchronize a complete folder manually to a remote (cms) server instance. You can even create an Outscaling scheduled event to execute e.g. every two hours to synchronize a pre-configured folder.

External webservice

What all these types of file synchronizations have in common, is that it is preferred to use the external webservice for them. This webservice is serviced through a separate Http Handler, and therefore it is non-blocking to the cms manager's process. So make sure this external webservice is properly configured within the web.config (see example below). Notice that the external webservice must be registered first within the httpHandlers/handlers, since the handler for the cms manager uses a wildcard as path parameter.

 

XML CopyCode image Copy Code
<location path="cms">
 <!-- IIS 6.0 and ASP.NET configuration -->
 <system.web>
  ...
  <httpHandlers>
   <clear/>
   <!--clear the inherited httpHandlers-->
   <add verb="*" path="/cms/webservice.dws" 
     type="Smartsite.Interop.IIS.WebserviceHandler,Smartsite.Interop"/>
   <add verb="*" path="/cms/*.dws" 
     type="Smartsite.Interop.IIS.Handler, Smartsite.Interop"/>
  </httpHandlers>
  ...
 </system.web>
 <!-- IIS 7.0 configuration -->
 <system.webServer>
  ...
  <handlers>
   ...
   <add name="ExternalWebserviceInteropHandler" path="/cms/webservice.dws" verb="*" 
     type="Smartsite.Interop.IIS.WebserviceHandler,Smartsite.Interop" preCondition=""/>
   <add name="CMSInteropHandler" path="/cms/*.dws" verb="*" 
     type="Smartsite.Interop.IIS.Handler,Smartsite.Interop" preCondition=""/>
  </handlers>
  ...
 </system.webServer>
</location>

File and Folder filtering

Another shared feature (as of iXperion 1.2) among these different file and folder synchronization types is the way file and folder filtering is being applied. In the end, it is the same method which is invoked to actually synchronize a file (folders will be created on the fly when they do not exist as part of synchronizing a file within the folder).

Within this method the file and folder filtering is applied, based on the FileExclusionList registry setting on the Outscaling background component. It has a built-in default of "thumbs.db;desktop.ini;*.dws;*.config;*.dll;*.exe;*.asax;*.asa".

For each file, the filename itself as well as the relative url of the file is compared against this exclusion list. This means, you can also exclude complete folders from file synchronization by specifying the relative url of the folder, followed by "*.*".

For example, when you include "/intranetdocuments/*.*;../system/restricted/*.*;*_confidential.*;" within the FileExclusionList, files and folders within /intranetdocuments (folder directly below the www) will be excluded, as well as files and folders within ../system/restricted and every file which filename matches the pattern *_confidential.*.

Filesystem SyncState

Whenever a file is synchronized to a cms subscriber as part of the automatic file-synchronization process (that is AIM references, items rendered as xml excluded of course), the file is registered within the Filesystem SyncState (the table osFilesystemSyncstate).

Also, when manually synchronizing a folder (or using an Outscaling Scheduled Event configured for this purpose) you have the option to register sent files to the Filesystem SyncState.

This table can be viewed within the Outscaling Console, and is also used internally by the Outscaling background component to keep track of which files have been sent previously.

Deleted Files

When files are deleted on the (main) cms server instance, there's no built-in mechanism for Outscaling to detect this, so the files will not be removed on the cms subscribers. Of course, there's the possibility to manually synchronize a complete folder with the option "delete target folder before synchronizing" selected (or use a scheduled event with the same settings), however this could mean you need to re-synchronize hundreds of files just to be able to delete a couple of files.

Thankfully, there's another, better option. Just create an Outscaling Scheduled Event with event subtype set to "SynchronizeFiles" and the mode set to "check previously sent files". Set its scheduling mode to e.g. interval and the interval/time to 8 hours.

The Outscaling background component will then execute this event every 8 hours. This event (Outscaling.SynchronizeFiles with mode set to check previously sent files) will use the Filesystem SyncState to check every registered file.

Files which are registered within this table but do not longer exist on the local filesystem will be removed on the target cms subscriber as well. Registered files which do not exist on the target cms subscriber or which are out-of-date will be (re-)synchronized. 

Conclusion

With the options described in this article, you can make sure files and folders on the cms subscriber(s) are completely in sync with the files and folders on the cms publisher. And you can also make sure it will not contain files which shouldn't be publicly available.