Hamed
Hamed

Reputation: 168

custom export/Import for alfresco

the obvious question is that is there any solution to export some alfresco contents which have a custom condition, for example export files which their create date is between a given date range?

the goal of this solution is: 1- to have a minimum mount of data volume in export/import action 2- in my weekly or monthly export/import action on backup alfresco server, I shouldn't have duplicate records for import action

thanks a lot for any kind of help

Upvotes: 0

Views: 1296

Answers (2)

jspuchau
jspuchau

Reputation: 21

Maybe you can use the Alfresco Replication Jobs to export your contents into a different repository.

In addition, you can export the contents to a file system using the FSTR feature.

Replication jobs use Alfresco Transfer Services that can be customised to only transfer some kind of content.

Upvotes: 1

Jeff Potts
Jeff Potts

Reputation: 10538

One idea is to use a library like OpenCMIS (Java) or cmislib (Python), both available from the Apache Chemistry project. Then use a CMIS query to restrict the data you want to export to a certain date range. If you want examples of CMIS queries, including ones that use date ranges, take a look at this Java example.

Another idea would be to use CMIS change tokens. Using this approach, you ask Alfresco what has changed since the last time your code ran. Alfresco responds back with a set of changes. You can then iterate over those changes and process them accordingly. The CMIS & Apache Chemistry in Action book has a change token example that uses Python to run a polling sync server between to CMIS repositories. The source code lives here.

Both of these options use CMIS. If you would rather have a native Alfresco option you could write a custom action that runs on a schedule to call the export. Or, you could use the File Transfer Service to write files to a file system on a schedule.

If what you are really trying to do is back up your repository, don't use any of these options. Instead you should be following standard practice for backup up the repo which is to dump the database and backup the content store.

Upvotes: 2

Related Questions