Thursday, 10 November 2016

Content Replication in alfresco

Replicating content from one server to another in alfresco 5.0
Steps:

a.      Identify two machines (IP address/host names with port numbers on which alfresco is running).
b.      On source machine:
                                                    i.     Create a folder or select a folder/file you want to replicate on target repository
                                                   ii.     Enable replication service (checkbox) from http://localhost:8080/alfresco/s/enterprise/admin/admin-replicationservice and click Save OR in alfresco-global.properties add property replication.enabled=true but it doesnot work when tried. So do it from share ui.
                                                  iii.     Here, the checkbox ‘Read Only Replication’ will be enabled (checked) by default. Uncheck it if you want that the content/folders can be edited/deleted by the target repository. Otherwise by default the content replicated on target will be read only. Click Save.
                                                  iv.     Go to Data Dictionary > Transfers > Transfer Target Groups > Default Group. This folder ‘Default Group’ has a rule to specialize the incoming type of folder to trx:transferTarget. So create a new folder here (any name for ex: oct5).
                                                   v.     Edit properties of folder oct5, specify the endpoint host (ip address/asset id of target), endpoint port (8080 if target alf running on 8080), username and pwd (admin/admin mostly for target alf). Click Enabled checkbox. Save.
                                                  vi.     Go to Admin tools > Replication jobs > Create Job. Specify name, Payload (folder you want to choose for replicating on target repository), Trasfer target as ‘oct5’, click Enabled.
                                                vii.     Now, make the target repository ready to accept the data. (i.e before starting the replication ensure that target repository is ready by following the step c mentioned below)
                                               viii.     Click Run
c.      On target machine:
                                                    i.     In alfresco-global.properties, add the property transferservice.receiver.enabled=true
                                                   ii.     In share-config-custom.xml, add the following entry:
<config evaluator="string-compare" condition="Replication">
      <share-urls>
              <share-url repositoryId="622f9533-2a1e-48fe-af4eee9e41667ea4">http://localhost:8080/share/</share-url>
</share-urls>
</config>
                                                  iii.     The repositoryId above should be taken from source repository, the source repository can give it to target by hitting the following url and getting the current repository id: http://localhost:8080/alfresco/s/enterprise/admin/admin-repositoryinfo
                                                  iv.     And for <share-url> value, keep localhost itself, don’t point it to source repository ip address or asset id.
                                                   v.     Start alfresco.

d.      Findings after the replication job is run:
                                                    i.     The nodeRefs of the source and target repository remains the same.
                                                   ii.     The folders/files created on target repo will have a replication symbol besides it with label ‘Transferred from another repository’.
                                                  iii.     The bpm package/workflow won’t be replicated to target repo.
                                                  iv.     All metadata/content along with permissions will be replicated to target repo. But for permissions to be replicated the same users/groups should exist on target repo as they are on source repo

7 comments:

  1. Can we customize alfresco replication service?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. U can if you want but alfresco provides transferService and replicationService APIs which u can use in ur java code and achieve what ur requirement is. If that is still not enough, then go for customization

    ReplyDelete
  3. I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in ALFRESCO, kindly contact us http://www.maxmunus.com/contact
    MaxMunus Offer World Class Virtual Instructor led training on ALFRESCO. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
    For Demo Contact us.
    Avishek Priyadarshi
    MaxMunus
    E-mail: avishek@maxmunus.com
    Skype id: avishek_2 .
    Ph:(0) 8553177744 / 080 - 41103383
    http://www.maxmunus.com/

    ReplyDelete
  4. Hi Sanket

    I have questions regarding the Replication Service in alfresco.
    In which scenarios it should be preferable to use replication services.
    Firstly,what is the limit of data that should be migrated using replication services.Secondly, In case we have custom metadata applied on docs in source repository then is it necessary same custom types must be present in target repository then only we will be able to replicate custom metadata values in target repo?
    As I am working on similar reqt in my project,Could you please help in suggesting in what use cases i must go with above approach.

    Thanks !
    Ashita saxena

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. are we able to transfer all versions of file on target node repo through replication services

    ReplyDelete