Skip to main content

Content sync between Plone sites

Project description

Content sync between Plone sites over plone.restapi

Documentation

Features

  • sync content folders or individual content objects to a remote Plone site

  • full sync for initial sync

  • incremental sync for content updates

  • configurable sync behavior per content type

  • trigger immediate sync upon create or update operations through content rules

Description

This add-on can be used to push changes from one Plone site to a list of configured other Plone sites (one-way-sync). They should have the same Plone Major versions, but it is not required. Depending on the content which is synced, the installed add-ons should match. The add-on uses plone.restapi to push the content.

You can configure a list of target sites (the Plone sites you want to sync to), with URL, username and password for a user who has at least the Contributor role.

To enable the content sync (push), you need to add a content rule with the content sync action. There is nothing more to configure for that rule, but it needs to be enabled either for the whole site or just a sub tree. So it is up to you when the sync should happen (content added, workflow changed, …).

The add-on comes with a behavior (an action and a manage screen would work too, but for the customer the behavor was the easier way). There you can add a configuration for all configured targets. The content sync can be enabled and also include all sub items. It also contains an option to exclude an item from the sync process.

With that you have almost unlimited options. For example, a products folder can be synced from example.com to sub1.example.com/products and sub2.example.com/products. Now one item in that products folder should not be synced to sub1, but to sub2. This can be achieved by excluding the item from sync, and then by adding a new sync configuration for sub2 starting at this point.

The add-on allows you to sync content immediately, manually or triggered by a cron job. This can be adjusted in the control panel. To sync via cron job, best is to create an instance script which calls the full sync method and call that with your cron job.

By default, only the object that triggered the content rule will be synced, not the sub content. This is to prevent long running tasks. You can do a full sync to sync all content, or just the items left in the queue (which might have failed for some reason).

There is also an option to exlude fields for updates. So when an item is created, all fields are synced. But on update you can choose which are ignored (e.g. for local customizations on the target site).

One more thing: the sync will only update existing content on the target site if the UID matches. For this to work there is a new restapi service to update the UID after the item was created on the target site. Maybe this (passing the UID) can be included in the restapi service for creating content.

Software requirements

  • Plone 5.2 or higher

  • Python 3

  • no support for Plone sites running on Python 2

Installation

collective.contentsync2 must be installed both on the source and target Plone site through buildout:

[buildout]

...

eggs =
    collective.contentsync2

Contribute

License

The project is licensed under the GPLv2.

Authors

  • Thomas Massmann (primary author)

  • Andreas Jung (collective.contentsync2 refactoring)

Contributors

Changelog

1.0b2 (2020-11-23)

  • moved main docs to RTD [zopyx]

1.0b1 (2020-11-22)

  • Initial release. [zopyx]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.contentsync2-1.0b3.zip (364.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page