0

we have to export alfresco data and import into another repository, and not necessarily backup/restore process. we are aiming for script which can be run and extract data on some conditions, set of files, with all its metedata.

i have got below link, which talks about same, but it is old , and things cant be done like versions of the file, condition based extract.

https://www.ibm.com/developerworks/cn/xml/x-cmis2/index.html

i would like to know any approaches available for extract and import of the alfresco data into other repositories..

pappu_kutty
  • 2,378
  • 8
  • 49
  • 93
  • Export from on Alfresco instance to another, or from Alfresco to/from a different (but CMIS-speaking) repository? – Gagravarr Nov 07 '17 at 07:52
  • Is automatic replication an option ? – Akah Nov 07 '17 at 07:55
  • @Gagravarr, export to another alfresco instance , like preprod, sandbox , QAc environment – pappu_kutty Nov 07 '17 at 08:58
  • @Akah, i dont know, automatic replication is an option, since we need to have some conditions before export – pappu_kutty Nov 07 '17 at 12:04
  • 1
    Because you have the possiblity to do some replication of data from one alfresco to other one : http://docs.alfresco.com/5.0/concepts/admintools-replication-config.html. You have the bulk import system too. – Akah Nov 07 '17 at 12:15

1 Answers1

3

There is nothing out-of-the-box that will do this. The replication sub-system is not suitable for frequent replication of more than a small handful of nodes.

So, you will have to write a custom solution or look at third-party solutions that can do this. Simflofy is one example. Another example is the Parashift Alfstream module.

If you would like to develop this yourself, I suggest you do something like:

  1. Write code to export one or more files to the file system. This should be storage that is shared between the source and all target repositories.
  2. Alongside each file, write a "manifest" file that descries the file's metadata, including custom properties and property values. You should use the same format that the Bulk File System Import Tool expects when doing an import.
  3. Add a message to a queue that describes where the exported data is sitting and where it needs to be imported.
  4. In the target repository, write a listener that is subscribe to the queue.
  5. When the listener gets a message it can initiate a Bulk File System Import in the target system. The BFSIT will import the files and set the metadata as described in the manifest file you generated in Step 2.
  6. Optionally, the target system can place another message on the queue acknowledging that the import has been performed, which the source repo can then pick up to complete the task.

Some people have been successful using Apache Camel for this, but it is not strictly necessary.

Jeff Potts
  • 10,468
  • 17
  • 40
  • Jeff..any code reference for exporting file from alfresco?.can we use Apache camel for exporting large set files? – pappu_kutty Nov 08 '17 at 12:42
  • @Jeff Potts : "The replication sub-system is not suitable for frequent replication of more than a small handful of nodes." => Could you please explain why ? This interests me a lot ! – Akah Nov 08 '17 at 14:39
  • @pappu_kutty, the export can be done from your custom class running in the Alfresco JVM by using the Alfresco Java API, see NodeService and ContentReader. Basically, you'll just grab the node using its node ref, get a CotnentReader for it, then write the bytes out to a file. – Jeff Potts Nov 08 '17 at 15:29
  • 1
    @Akah, my experience has been that the jobs fail often, especially if there is any amount of latency between the source and target repositories. When the jobs fail there is not a great way to be notified of the failure, and determining what went wrong or how to recover can be difficult. The number of people writing their own solution for this also confirms that the out-of-the-box solution is inadequate most of the time. It's probably okay for a handful of small nodes replicated infrequently. – Jeff Potts Nov 08 '17 at 15:33
  • @JeffPotts, we have started evaluating products available, custom tool development will be our last option.. – pappu_kutty Nov 08 '17 at 16:48