Sync Imported database with Exported folders

I have a structure whereby my data is imported into a DEVONthink “Master” database. I prefer it to be Imported, (for ease of backing up and moving databases etc), and not indexed. This Master is our “Library” of information, and only a couple of users have authority to edit content. This Master is Synced to by a number of remote users via WebDAV and it works wonderfully well. (The remote users are disciplined enough to view the data only - understanding they are not allowed to make any changes).

(I very much hope Sync2 when it comes will enable 1-way syncs so that our Master can be protected by default.)

To enable our non-Mac users to have access to the same Master information, I Exported a full copy to the folders\files structure - and this is now accessible to Windows users across our internal network.

I want to be able to re-Export the data on a regular basis to keep the Windows users updated - but have the problem where exporting keeps duplicating (Folder-1) rather than overwriting - so I would need to first delete the folders and then Export as new.

Ideally the Export function would simply overwrite to the same locations, and even more ideally, only those files which have changed, or are new…

(I wonder if the “Hazelification” rumoured to be coming soon might offer this kind of possibility…?)

I realise an “Indexed” database offers more possibilities - but I really would prefer to stay with the Imported one. A further problem arises where the Windows users are very much more likely to accidentally edit, overwrite or delete files, and this must not be allowed to sync back to the Master database. (Not meant as a reflection on Windows users by the way…)

I have trawled the forums looking at various possibilities, hoping to maybe find some ideas or maybe a script which might suggest how to do this, but no luck. (I am not very capable with scripts, only at tweaking the simplest code).

I experimented with having the Master (imported) database and a duplicate which was indexed (Master_Indexed). The Master_Indexed folder\file structure was then itself also duplicated to another folder - which was made accessible to Windows users. (I used Hazel to keep it up to date with a 1-way copy to prevent errors coming back).

My idea was to keep the established Mac users WebDAV sync with the Master database as normal, and then somehow sync the Master to the Master_Indexed - which would in turn keep the Windows structure updated.

I don’t mind having multiple copies of the data “chained” if necessary to make this work. The Master sits on a Mac reserved for the sole purpose of being the central library - for sharing data in the outward direction only.

Any ideas on the best way of achieving this?

A couple of possibilities – I’'m sure there are others

  1. I assume you have, or could adjust your method to create, a top-level folder that contains the hierarchy of exported folders/documents. For discussion, say the top level is “Export Master”. Create a second folder, call it “Export Master Staging”. It appears you might be familiar with Hazel (or could become familiar with it). If so, then your process could be
  • Periodically export the database hierarchy to “Export Master Staging”
  • Configure Hazel to watch"Export Master Staging"
  • When a change is detected (i.e., the export happens), Hazel deletes “Export Master”, and then Hazel changes the name of “Export Master Staging” to “Export Master”
  1. The DEVONthink scripting dictionary has the command “Export” so a simple script could be written to
  • Tell Finder to delete the contents of “Export Master”
  • Tell DEVONthink to export the Master database to "Export Master

A risk in both methods (and the status quo) is one of your correspondents modifies something in one generation of “Export Master” that is overwritten in the next generation.

Thanks Korm, I will experiment with 1. and see how practical that is.

I’ll leave any scripting till I have a clear method worked out.