-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Content Sync #3151
Feature: Content Sync #3151
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3151 +/- ##
============================================
+ Coverage 55.25% 55.37% +0.11%
- Complexity 5435 5527 +92
============================================
Files 713 723 +10
Lines 29109 29574 +465
Branches 3767 3842 +75
============================================
+ Hits 16084 16376 +292
- Misses 11512 11675 +163
- Partials 1513 1523 +10
|
…to rsync --delete)
@YegorKozlov is this read for review? |
yes @davidjgonzalez . it's ready for review |
04dd367
into
Adobe-Consulting-Services:master
Hi @YegorKozlov, Is it possible to sync only root page without child pages below it? Like only this path /content/site/en/home/jcr:content |
In the current implementation it's not possible. I'm thinking of adding a new Query strategy, so that instead of a path user would pass a jcr query. This way you will have a finer control what to sync. |
* new feature: content sync
Purpose
Incrementally synchronize content between AEM Author instances.
ACS Content Sync is yet another solution aiming to overcome the shortcomings of using CRX Package Manager / VLT RCP to copy content between AEM environments.
How does Content Sync Work?
Content Sync uses JSON Export/Import between Sling GET/POST servlets. The tool fetches a catalog of resources from the source instance, e.g.
then it compares it with the local state, computes the delta and synchronizes it via JSON Export/Import.
How many HTTP calls does Content Sync make?
The ballpark estimation is O(N) where N is the number of content resources (cq:Page, dam:Asset, etc.) being sync-ed.
For example, it takes an HTTP call to sync a cq:Page resource, so to sync a tree of N cq:Page nodes the tool will make minimum N HTTP calls. To sync a dam:Asset node the tool will make an HTTP call to grab the jcr:content and sub-nodes, and an HTTP call to grab binary data for each rendition.
What can I sync?
In general - any content resources, like
How to Use
In order to use the Content Sync tool, you need the latest version of ACS Commons installed on the source and target AEM instances.
Configure Sling Get Servlet
Create an OSGi configuration for PID org.apache.sling.servlets.get.DefaultGetServlet and make sure that:
Configure the host(s) to synchronize from
Navigate to the Content Sync tool (http://localhost:4502/apps/acs-commons/content/contentsync.html) and click the Configure button in top right corner. Then click Add Host
The contentsync-user user needs read permissions on the content you are going to sync.
Run the Content Sync tool
Navigate to the Content Sync tool http://localhost:4502/apps/acs-commons/content/contentsync.html and select a path to synchronize.
The default mode is Incremental, which means only new or modified resources will be downloaded. If the Incremental option is unchecked then the tool will do full sync and download the entire content tree.
The 'On-complete' workflow option allows you to define a custom post-update action. For example, you can define a workflow to clear properties like cq:replicationStatus, or automatically publish a resource if it is published in the source environment.
Pluggable Update Strategy
The strategy to select incremental delta is pluggable.
The default algorithm is based on the cq:lastModified/jcr:lastModified timestamp.
As an example, Content Sync ships with another strategy which synchronizes dam:Asset nodes based on the dam:sha1 checksum in the asset metadata. Users can plug-in their custom strategies by implementing
com.adobe.acs.commons.contentsync.UpdateStrategy
interface;