In some of the Alfresco implementation customer has adopted the architecture where they have separate content authoring environment and content serving environment or there is a requirement where contents need to be replicated in multiple servers to provide high availability.
Replication job is a feature in Alfresco that allows you to control the replication of content between different Alfresco repositories. A replication job specifies the content to be replicated; the day and time the job is to be performed; and the target location for the replicated content.
The replication service is responsible for persisting replication jobs that specify what is to be replicated, to where, and when. In addition, it monitors the status of currently executing replication jobs and allows you to cancel replications. The replication service finds the nodes that need to be transferred, and then it delegates to the transfer service.
Admin can manage replication jobs using the Admin Console tool in Alfresco Share, which provides the user interface for the replication service.
By default, any replicated content is read-only in the target repository. This ensures the integrity of the content is not compromised by uncontrolled updates.
Before you can use the replication jobs feature, you must set up few things.
Creating a new transfer target for replication jobs
Transfer target refers the repository where contents should be transferred. Out of the box, one target group, default group, is available.
The files that control and monitor the operation of the transfer service are stored in the Transfer space in the Data Dictionary. The Transfer Target Groups space contains the transfer target definitions that specify where transfers go to. There is a group level below the folder which is used to classify different sets of transfer targets.
You can add transfer targets by creating a folder in Alfresco Explorer or Alfresco Share.
Use the Repository Browser to create additional target groups
- Create folder under (Company Home > Data Dictionary > Transfers > Transfer Target Groups > Default Group).
- Modify the folder properties and set the following values:
Endpoint Host: Target Server name
Endpoint Port: 9090
Username: Target Server username
Password: Target Server password
Transfer Target enabled: checked
A rule defined on the Default Group folder specialize the type of any folder created within it. The type is set to trx:transferTarget, which you can then complete through the user interface.
Create New Replication Job
Once new target is crated you can go for creating new job.
- Navigate to the Admin console> Replication Jobs in the Tools list.
- Under Jobs section, click Create Job.
- The Create New Replication Job page appears. Fields marked with an asterisk (*) are required.
- Give details as shown in give Image.
- Details of few important fields in given form
- · Select the payload.
In the Payload section, click Select. Navigate the repository and click Add to the right of each branch of the repository that you want to include in the payload; this is the content that will be replicated (copied) when the job is run. Click OK.
- · Specify the transfer target.
In the Transfer Target section, click Select. Navigate the Transfer Target Groups and click Select to the right of the desired target. Click OK. Make sure you have created proper target as specified above.
- · Schedule the replication job.
Select the Schedule job check box, then enter the date and time the job is to run. Specify the repeat period for this job. It will allow you to set intervals at which it should be repeated.
Select Enable Check box click on Create job and you are good to go.
There lot more details related to replication jobs this blog covers details about how jobs can be created I will provide details about how existing jobs can be managed in upcoming blogs.