---
title: "ContentSync plugin"
---

# ContentSync plugin

## Installation

## What you need first

ContentSync works with two sites. The **source site** is where your articles are written. The **target site** is where the copies go. You install the plugin on the target site only.

On the target site:

- Joomla 5.0 or newer, or Joomla 6
- PHP 8.1 or newer
- The Joomla Task Scheduler running. It is part of Joomla and on by default.

On the source site:

- Joomla 5 or Joomla 6. What can be copied differs between the two: see [Joomla 5 and Joomla 6](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=475&catid=118).
- The Joomla Web Services API reachable from the target site. It is part of Joomla, and the plugins it needs are on by default.
- An API token of a user who may use the API. By default that is a Super User.

You do not install anything on the source site.

## Installing the plugin

ContentSync is one single plugin. The free edition comes as `plg_task_contentsync_vX.X.X.zip`, the PRO edition as `plg_task_contentsync_vX.X.X_PRO.zip`. What each edition does is listed in [Free and PRO](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=476&catid=118).

On the target site, go to **System \> Install \> Extensions \> Upload Package File** and upload the zip file. The plugin switches itself on after the install.

Right after installing, nothing happens yet. ContentSync is a task for the Joomla Task Scheduler, and it only runs once you have added that task. [Your first sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=466&catid=118) walks you through it.

## Going from Free to PRO

Install the PRO zip over the free edition, the same way. You do not remove anything first. Your task keeps all its settings, and the PRO options appear in the same form.

## Updates

Updates arrive through the normal Joomla updater: **System \> Update \> Extensions**.

The free edition needs no key. For the PRO edition you enter your download key once: go to **System \> Update \> Update Sites**, open *Joomill ContentSync plugin* and paste the key. You find the key in your account on joomill-extensions.com.

Installing a newer version over the old one keeps your tasks and their settings.

## Removing the plugin

Uninstall it under **System \> Manage \> Extensions**. The plugin also deletes its own database table. That table only remembers which article on the source belongs to which article here.

The articles that were copied stay on your site, with their images. They are normal Joomla articles. Remove the scheduled task as well, under **System \> Manage \> Scheduled Tasks**.

If you install ContentSync again later, it no longer knows which articles it copied before, so it would create them a second time. Keep that in mind before you remove it from a live site.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/installation.md)

## Your first sync

This article takes you from a fresh install to a working sync. It takes about ten minutes. You need to be able to log in to the administrator of both sites.

## 1. Create an API token on the source site

The source site is the site your articles come from. Log in to its administrator.

1. Go to **Users \> Manage** and open a Super User. A separate user just for this is a good idea, so you can switch the sync off later without touching your own account.
2. Open the tab **Joomla API Token**.
3. Set **Active** to Yes and save. The token appears in the field. If the field is empty, save the user once more.
4. Copy the token.

The token is a password. Anyone who has it can read your site through the API, so do not mail it around.

## 2. Add the task on the target site

The target site is the site the articles go to. This is where you installed ContentSync.

1. Go to **System \> Manage \> Scheduled Tasks** and click **New**.
2. Choose **Content Sync: Synchronise Articles**.
3. Give the task a title you will recognise, for example *News from example.com*.
4. Under **Source Site URL**, enter the address of the source site, for example `https://www.example.com`.
5. Under **API Key (Token)**, paste the token.
6. Under **Default Target Category**, choose the category the articles should go into.

Do you only want the articles of one category? Enter its ID under **Source Category ID**. You find the ID in the category list of the source site, in the last column. Leave the field empty to copy every published article.

Every field is explained in [Configuration](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=467&catid=118).

## 3. Do a dry run

Before anything is written, look at what the task would do.

1. Set **Dry Run (Preview)** to Yes and save the task.
2. In the task list, click the **Run Test** button of your task.
3. Read the result. It tells you how many articles would be created.

A dry run writes nothing to the database and downloads no files. The switch turns itself off after the run. [Dry run and logging](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=474&catid=118) shows where to read the details.

Do you get an error instead? [Troubleshooting](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=479&catid=118) lists the usual causes. A token from the wrong site is the most common one.

## 4. Run it for real and give it a schedule

Click **Run Test** again. This time the articles are created, and their images are downloaded.

Open the task once more and set how often it should run, under **Execution Rule**. Once an hour is a sensible start for a news section. A run that finds nothing new is quick: an article that has not changed since the last run is skipped.

## What happens next

- A new article on the source appears on the target after the next run.
- A changed article is updated.
- An article you change on the target site is overwritten the next time it changes on the source. Edit on the source, not on the copy.

[How it works](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=468&catid=118) explains this in more detail.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/your-first-sync.md)

## Configuration

All the settings sit in the scheduled task, not in the plugin. Go to **System \> Manage \> Scheduled Tasks** and open your ContentSync task. A setting marked PRO is shown as an upgrade badge in the free edition.

## Source API Connection

- **Source Site URL** - the address of the site the articles come from, for example `https://www.example.com`. No `/administrator` and no `/api` behind it.
- **Allow http Source** - off by default. A source address that starts with `http://` is only used when this is on, because the API token would otherwise travel unencrypted. Only switch it on for a source you reach over a network you trust, such as a local test site.
- **API Key (Token)** - the API token of a user on the source site. [Your first sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=466&catid=118) shows where to find it. The field is masked and locked: click the lock to change the token.
- **Request Timeout (seconds)** - how long to wait for the source to answer. The default is 30.
- **Verify SSL Certificate** - checks the certificate of the source site. Leave this on. Only switch it off for a local or staging site that has no valid certificate.

## Article Filters

The filters decide which articles the source hands over. They are explained in [Choosing which articles to sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=469&catid=118).

- **Source Category ID** - one category in the free edition, a comma-separated list in PRO.
- **State Filter** - published, unpublished, archived or all. The default is published.
- **Source Tag IDs**, **Language Filter**, **Featured Filter** and **Workflow Stage** - PRO.

## Local Target Settings

- **Default Target Category** - the category on this site the articles go into.
- **Use Category Mapping**, **Category Mapping**, **Tag Mapping**, **Author Mapping**, **Default Author** and **Access Level Mapping** - PRO. See [Categories, tags, authors and access levels](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=470&catid=118).
- **Unmapped Access Levels** - what to do with an article that has an access level you created yourself and that is not mapped. The default is the safe one: the most restrictive level of this site.

## Synchronisation Behaviour

- **Dry Run (Preview)** - go through a run without writing anything. See [Dry run and logging](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=474&catid=118).
- **Force Resync** - process every article again for one run, also the ones that did not change.
- **Mirror Images** - download the images of an article. On by default.
- **Filter Article HTML** - remove scripting from the article text before it is stored. On by default. See [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).
- **Allowed Embed Hosts** - embeds from these sites survive the HTML filter. The default is `youtube.com, youtube-nocookie.com, player.vimeo.com`, so videos stay in the article. Separate the hosts with commas. Leave the field empty to remove every embed.
- **Media Folders**, **Mirror Documents and Media** and **Maximum File Size (MB)** - PRO. See [Images, documents and media](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=471&catid=118).
- **Sync Custom Fields** and **Field Mapping** - PRO. See [Custom fields](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=472&catid=118).
- **Incremental Sync**, **Handle Deleted Articles** and **Action for Removed Articles** - PRO. See [Removed articles and incremental sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=473&catid=118).
- **Sync Schema.org Data** - PRO. Copies the structured data of an article. Needs Joomla 6.2 or newer on the source.
- **Rewrite Relative Links** - PRO. Puts the address of the source site in front of relative links in the article, so they keep working on a site with other menu items. Links to files that were mirrored stay as they are, and so does every link that starts with a scheme, such as `mailto:`, `tel:` or `whatsapp:`.
- **Map Links Between Articles** - PRO. A link to another synced article points at the copy on this site instead of the article on the source. See [How it works](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=468&catid=118).
- **Take Over Articles With the Same Alias** - off by default. What happens when a new article from the source has the same alias as an article that is already in the target category. Off: the new article gets the alias with a number added, and the existing article is left alone. On: the existing article is taken over and from then on updated by the source.
- **Batch Size** - how many articles are asked for in one request. The default is 25. A lower number uses less memory, a higher number needs fewer requests.
- **Maximum Run Time (seconds)** - the default is 120. When the time is up, the run stops after the batch it is working on, and the next run continues with the next batch. The scheduler starts that next run straight away. 0 means no limit. See [Removed articles and incremental sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=473&catid=118) for how this works with removed articles.

## Logging & Debugging

- **Log Level** - how much is recorded. *Info* is the normal setting. Choose *Debug* while you are setting things up.
- **Write Log to File** - also write the log to `administrator/logs/contentsync.php`.

## The schedule

How often the task runs is a setting of the Joomla Task Scheduler, under **Execution Rule** in the same form. ContentSync has no schedule of its own.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/configuration.md)

## How it works

## One direction

ContentSync copies articles from a source site to a target site. Never the other way. The source site is the original, and the target site follows it.

The plugin runs on the target site. It asks the source site for its articles through the Joomla Web Services API, the same API that Joomla itself offers to apps and other systems. The source site does not know or care that ContentSync exists.

## What a run does

Every time the task runs, it goes through these steps:

1. It asks the source for its articles, a batch at a time. Filters decide which articles the source hands over.
2. For every article it checks whether it has seen that article before.
3. A new article is created. A known article that has changed is updated. A known article that has not changed is skipped.
4. Images in the article are downloaded if they are not on the target site yet.
5. The article is saved the way Joomla saves an article from the editor: Smart Search indexes it, featured articles show up under Featured Articles, and other plugins that react to a saved article see it too.
6. At the end, the article cache is cleaned, so visitors see the new version, and the result is written to the log.

## How it knows what changed

ContentSync keeps a small list of its own: which article on the source belongs to which article on the target, and when that source article was last modified.

On the next run it compares the modification date of the source article with the date it remembered. Only when the source is newer, the article is processed again. That is why a run on a site where nothing changed takes very little time.

Do you want every article processed again, for instance after you changed a setting? Switch on **Force Resync** for one run. The switch turns itself off afterwards.

## What is copied

- The title, the alias and the text
- The publication state, the publish dates and the featured flag
- The language
- The meta description and keywords
- The intro image and the full article image, and the images in the text
- The links A, B and C of the article

The PRO edition adds tags, custom fields, documents and media, and Schema.org data.

## Links between articles

A link that an editor makes with the **Article** button in the editor points at the number of that article on the source. On the target site that number belongs to another article, or to none.

With **Map Links Between Articles** on, a PRO option, ContentSync points such a link at the copy on the target site, with its category. This happens at the end of a run, so a link to an article that was copied later in the same run is mapped as well. A link to an article that is not synced stays as it is.

## What is not the same on both sites

Some things in an article are only a number: the category, the author and the access level. Those numbers mean something else on every site. Category 8 on the source may be *News*, and category 8 on the target may be *Products*.

So ContentSync does not copy those numbers blindly. Every article goes into the category you choose. In the PRO edition you can map categories, authors, tags and access levels one by one. [Categories, tags, authors and access levels](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=470&catid=118) explains how.

## Changes on the target site

A copied article is a normal Joomla article. You can open and edit it. But the next time that article changes on the source, the copy is overwritten with the source version.

The rule of thumb: edit on the source. Treat the target as a mirror.

## What ContentSync leaves alone

- Articles on the target site that it did not create itself. It never touches them, not even when one has the same alias as an article from the source, unless you switch on **Take Over Articles With the Same Alias**.
- Categories, menus, modules and users. It copies articles, not the site around them.
- The source site. It only reads there.

## More than one source

A task has one source site. Add the task again for every extra source, or for every category that should go somewhere else. Each task has its own settings and its own schedule.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/how-it-works.md)

## Choosing which articles to sync

Without a filter, ContentSync copies every published article of the source site. Usually you want less than that. The filters decide which articles the source hands over.

A filter works on the source site. An article that does not pass is never fetched at all, so a tight filter also makes a run quicker.

## In both editions

### Source category

Enter the ID of a category on the source site. You find the ID in the category list of the source, in the last column.

- In the free edition the field is called **Source Category ID** and takes one category.
- In PRO it is called **Source Category IDs** and takes a list, separated by commas, for example `2,5,8`.

Leave it empty to copy from every category.

If you type a list in the free edition, the first category is used. The log says which ones were ignored. The list stays in the task, so it takes full effect once you install PRO.

### State

**State Filter** chooses the publication state: published, unpublished, archived, or all states. The default is published.

## In PRO

### Tags

**Source Tag IDs** takes a list of tag IDs from the source site, for example `4,7,12`. Only articles with one of those tags are copied.

This is a handy way to pick articles by hand. Make a tag on the source site, for instance *Share*, and give it to every article that should travel.

### Language

**Language Filter** limits the sync to articles in the languages you pick.

### Featured

**Featured Filter** has three choices: all articles, only featured articles, or everything except featured articles.

### Workflow stage

**Workflow Stage** takes the ID of a stage in the workflow of the source site, for example a stage called *Ready to share*. Enter 0 to switch the filter off.

This filter needs Joomla 6.2 or newer on the source site. An older source ignores it and hands over everything. See [Joomla 5 and Joomla 6](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=475&catid=118).

## Using more than one filter

Filters add up. With a category and a tag, an article has to be in that category and carry that tag.

## Changing a filter later

A filter only decides what is fetched from now on. Articles that were copied earlier stay on the target site.

There is one thing to watch in PRO. With **Handle Deleted Articles** switched on, an article that no longer comes through the filter is treated as removed from the source, and the action you chose is applied to the copy. So narrowing a filter can move earlier copies to the trash. Do a [dry run](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=474&catid=118) after you change a filter, and read what it would delete.

## Sending different articles to different places

One task has one set of filters. To send the news to one site section and the events to another, add the task twice, each with its own source category and its own target category.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/choosing-which-articles-to-sync.md)

## Categories, tags, authors and access levels

Categories, tags, users and access levels are stored in an article as a number. Those numbers are different on every site. Category 8 may be *News* on the source and *Products* on the target.

A mapping tells ContentSync which number on the source belongs to which number here. You write one pair per line: the source ID, a colon, the local ID.

```
3:7
4:9
```

That reads as: source 3 becomes 7 here, and source 4 becomes 9 here. You find an ID in the last column of the list in the Joomla administrator, for categories, tags, users and access levels alike.

The mappings are part of the PRO edition. The free edition puts every article in one category and keeps the author as it is.

## Categories

**Default Target Category** is where articles go. In the free edition that is the whole story: everything lands there.

In PRO, switch on **Use Category Mapping** and fill in **Category Mapping**. An article from a mapped category goes to its counterpart. An article from a category that is not in the list goes to the default target category.

The categories have to exist on the target site. ContentSync does not create them.

## Tags

**Tag Mapping** works the same way, with tag IDs. A tag that is not in the list is left out. Leave the field empty and tags are not copied at all.

## Authors

**Author Mapping** connects a user on the source to a user here. **Default Author** is the user that gets every article whose author is not in the list.

If you fill in neither, the article keeps the user number from the source. On the target that number belongs to somebody else, or to nobody. The log warns you when that happens. Setting a default author is the simple fix.

## Access levels

The access level decides who may read an article. Getting this wrong can show an article that is meant for members to everyone, so ContentSync is careful here.

### The levels Joomla installs need no mapping

Public, Registered, Special, Guest and Super Users have the same ID on every Joomla site. An article with one of those levels gets the same level on the target. You do not have to map them.

### Levels you created yourself

A level you made yourself, for example *Members*, has whatever ID it happened to get. Add it to **Access Level Mapping**, so ContentSync knows which level on this site is the same audience.

### When a level is not mapped

**Unmapped Access Levels** decides what happens to an article with a level of your own that is not in the mapping. This setting is in both editions.

- **Use the most restrictive local view level** - the default. The article gets the level with the smallest audience that visitors cannot see. On a standard site that is Super Users. The article is there, but hidden until you map the level.
- **Skip the article** - the article is not copied.
- **Reuse the number from the source** - only for two sites whose access levels are numbered the same, for instance a copy of one site. On any other pair of sites this can show a members-only article to the wrong audience.

Every article that falls back this way is named in the log, with the level that was missing.

## After you change a mapping

A mapping is applied when an article is created or updated. Articles that were copied before keep what they had. Switch on **Force Resync** for one run to apply the new mapping to all of them.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/categories-tags-authors-and-access-levels.md)

## Images, documents and media

An article is more than text. ContentSync also brings the files along that the article uses, so the copy does not depend on the source site to show its pictures.

## Images

With **Mirror Images** on, which is the default, ContentSync downloads:

- the images in the article text;
- the intro image and the full article image.

An image keeps its path. `images/news/team.jpg` on the source becomes `images/news/team.jpg` on the target. Folders that do not exist yet are created.

An image that is already on the target site is not downloaded again. That keeps a run quick, and it also means that an image you replaced on the source under the same file name is not refreshed. Give a new picture a new file name.

The accepted image types are JPG, PNG, GIF, WebP and AVIF. SVG files are not mirrored, because an SVG can carry script.

Images on another website, for example a picture that is linked straight from an image service, are left as they are. The article keeps pointing at that address.

## Documents, audio and video

This part needs the PRO edition. Switch on **Mirror Documents and Media**, and ContentSync also downloads the files your articles link to or play:

- documents: PDF, Word, Excel and PowerPoint files, OpenDocument files, text and CSV files;
- audio: MP3, M4A, OGG and WAV;
- video: MP4, WebM and MOV.

It finds them in the links of the article and in audio and video players. A link to a file that was mirrored keeps pointing at your own site, also when **Rewrite Relative Links** is on.

## Media folders

Files are only written inside the folders you allow. In the free edition that is the folder `images`.

In PRO the setting **Media Folders** takes a list, separated by commas. The default is `images,files`, the two folders of the Joomla Media Manager. Does the source keep its downloads somewhere else, for example in `media/downloads`? Add that folder to the list.

A file outside these folders is skipped, and the log tells you which one.

## Maximum file size

A file larger than the limit is skipped and named in the log. The limit is 25 MB. In PRO you can change it with **Maximum File Size (MB)**.

A file is held in memory while it is downloaded. Keep the limit below the PHP memory limit of your site. For large videos a video platform is usually the better home anyway.

## The checks every file goes through

A file comes from another site, so it is checked before it is written:

- its type has to be on the list above;
- its content has to match its extension. A file named `.jpg` that is not a JPEG is refused;
- it may not contain PHP code;
- its path may not lead out of the media folders.

These checks are in both editions and cannot be switched off. [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118) explains why.

## During a dry run

A dry run downloads nothing. The log lists the images and files that a real run would fetch.

## Files in custom fields

The image or file of a media custom field is mirrored as well, as part of [custom field syncing](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=472&catid=118).

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/images-documents-and-media.md)

## Custom fields

Custom fields are the extra fields you add to articles in Joomla, such as a subtitle, a price or an event date. With the PRO edition, ContentSync copies their values along with the article.

## Create the fields on the target site first

ContentSync copies values. It does not create fields. Before you switch this on, make the same fields on the target site, under **Content \> Fields**.

Two things have to be the same on both sites:

- the **Name** of the field. That is the technical name, not the title. You find it in the field itself, under the title;
- the **Type** of the field.

The title, the description and the field group may be different.

## Switching it on

Open your task and set **Sync Custom Fields** to Yes.

From the next run, every article that is created or updated gets its field values. The log tells you how many fields are synced, and names every field that is skipped with the reason.

Articles that were copied before only get their fields once they change on the source. To fill them all in at once, switch on **Force Resync** for one run.

## When a field has another name

Is the field called `subtitle` on the source and `sub-title` on the target? Add a line to **Field Mapping**: the name on the source, a colon, the name here.

```
subtitle:sub-title
```

You only need this for fields whose names differ. Fields with the same name are matched by themselves.

## Supported field types

- Text, textarea and editor
- URL
- Integer and number
- Calendar
- Color
- List, radio and checkboxes
- Media and media file

For a list, radio or checkboxes field, give the options the same values on both sites. The value is what is stored, the label is only what you see.

For a media field, the image is downloaded to the target site, under the same rules as other images. See [Images, documents and media](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=471&catid=118).

## Field types that are skipped

- **User**, **user groups** and **SQL** fields. Their value is the number of a user, a group or a database row, and that number means something else on another site.
- **Subform** fields. A subform refers to its inner fields by number.
- **List of images**. It depends on a folder that is set inside the field.
- Field types that come from another extension.

A skipped field is named in the log once per run. The rest of the article is copied as usual.

## What the source site has to allow

To know the type of each field, ContentSync asks the source site for its list of fields, once per run. The user whose API token you use needs access to **Fields** on the source site. A Super User has that.

If the list cannot be read, custom fields are left out for that run, with a warning in the log. The articles themselves are still copied.

Only published fields are synced. A field that is unpublished on the source sends no values.

## Good to know

- Textarea and editor fields go through the same HTML filter as the article text.
- A URL field only accepts a web address or a path. Anything that could run script is left out.
- A field that is empty on the source gets the default value of the source field, because that is what Joomla hands over.
- When an article is permanently deleted by ContentSync, its field values are removed too.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/custom-fields.md)

## Removed articles and incremental sync

Copying new and changed articles is half the job. A mirror also has to deal with articles that disappear, and on a large site it should not ask for everything every time. The options in this article are part of the PRO edition. Force Resync and Maximum Run Time are in both editions.

## Articles that are removed from the source

In the free edition, a copy stays on the target site when its original is removed. Nothing happens to it.

In PRO you decide. Switch on **Handle Deleted Articles** and choose under **Action for Removed Articles** what happens to the copy:

- **Move to Trash** - the default. The copy goes to the trash of the target site, where you can still get it back.
- **Unpublish** - the copy stays, but visitors no longer see it.
- **Permanently Delete** - the copy is deleted, with its tags and field values. This cannot be undone.

### What counts as removed

ContentSync compares the articles it copied before with the articles the source hands over in this run. A copy whose original is not in that list any more counts as removed.

That is wider than deleted. An article also counts as removed when:

- it was unpublished on the source, while your state filter asks for published articles;
- it was moved to a category that your filter does not include;
- you narrowed a filter in the task yourself.

For a mirror this is usually exactly what you want: what is no longer shown on the source is no longer shown here. But it means a change to a filter can touch many copies at once. Do a [dry run](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=474&catid=118) first. The log lists every article it would trash, unpublish or delete.

There are safety nets. Removed articles are only handled after a run that got the complete list from the source:

- When a batch could not be fetched, because the source was slow, down or gave an error, nothing is treated as removed. The articles on the missing batch are not gone, they were just not seen.
- When the run logged an error, nothing is treated as removed either.
- When the source hands over no articles at all, nothing is treated as removed.

The log says when and why removal was skipped. The next complete run handles it.

### Removed articles and Maximum Run Time

A large sync can be spread over several runs: when **Maximum Run Time** is up, the run stops and the next one continues with the next batch. A run that continues an earlier one has not seen every article, so it does not handle removed articles. The log says so.

This only matters for a sync that does not fit in one run every time. A first sync is usually the big one, and there are no removed articles yet. If your regular runs are spread over several runs too, raise Maximum Run Time, or set it to 0 for a task that runs from a real cron job, where there is no PHP time limit to worry about.

## Incremental sync

A normal run asks the source for every article that passes the filters, and then skips the ones that did not change. On a site with thousands of articles that is a lot of asking.

With **Incremental Sync** on, the task only asks for articles that were modified since its last successful run. It remembers that moment in **Last Sync Watermark (UTC)**, which it fills in by itself.

**Incremental Overlap (minutes)** moves that moment a little back in time, to allow for clocks that are not exactly equal on the two servers. The default of 10 minutes is a safe choice.

### Two things to know

- **It needs Joomla 6.2 or newer on the source site.** An older source ignores the question and hands over everything. See [Joomla 5 and Joomla 6](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=475&catid=118).
- **An incremental run does not handle removed articles.** It only sees what changed, so it cannot tell what is gone. The log says so when both options are on.

To get both, use two tasks for the same source: one incremental task that runs often, and one full task with Handle Deleted Articles that runs once a day or once a week. Or clear the watermark field now and then, which makes the next run a full one.

## Force Resync

**Force Resync** makes one run process every article again, whether it changed or not. The switch turns itself off after that run.

Use it after you changed something that applies to articles that were already copied:

- a mapping for categories, tags, authors or access levels;
- switching on custom fields, or documents and media;
- the HTML filter or link rewriting.

A forced run overwrites every copy with the source version. Changes made by hand on the target site are lost.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/removed-articles-and-incremental-sync.md)

## Dry run and logging

## The dry run

A dry run goes through a complete run and changes nothing. It talks to the source site, works out what it would do with every article, and writes that to the log.

During a dry run:

- no article is created, updated or removed;
- no image or file is downloaded;
- no custom field is written.

Use it the first time you set up a task, and every time you change a filter, a mapping or the handling of removed articles.

### How to do one

1. Open your task under **System \> Manage \> Scheduled Tasks**.
2. Set **Dry Run (Preview)** to Yes and save.
3. Click **Run Test** in the task list, or wait for the schedule.

The switch turns itself off when the run has finished. The run after that is a real one. If a dry run stops early, for instance because the source cannot be reached, the switch stays on, so you still get your preview on the next try.

### Reading the result

Every line of a dry run starts with `[DRY RUN]`:

```
[DRY RUN] No changes will be written to the database.
[DRY RUN] Would download image: /images/news/team.jpg
[DRY RUN] Would create: "Our latest news article" (source: 128)
[DRY RUN] Would update: "Summer opening hours" (source: 97 -> local: 214)
[DRY RUN] Completed - would create: 1 | would update: 1 | would delete: 0 | skipped: 23 | errors: 0
```

*Skipped* counts the articles that have not changed since the last run. On a mirror that is up to date, almost everything is skipped. That is the normal picture.

## Where the log is

There are two places.

- **The task log.** Go to **System \> Manage \> Scheduled Tasks** and open **Execution History**. It shows the result of every run, with the summary and every warning and error.
- **The log file.** With **Write Log to File** on, every line is also written to `administrator/logs/contentsync.php`. This is the place for the full detail, line by line.

The Execution History only exists when task logging is switched on in the options of the Scheduled Tasks component.

## Log levels

**Log Level** sets how much is recorded:

- **Debug** - everything, including every request to the source. Use this while you set a task up or look for a problem.
- **Info** - what was created, updated, downloaded and removed. The normal setting.
- **Warning** - only the things that need your attention.
- **Error** - only failures.

## Warnings worth acting on

- **A view level, category or author that is not mapped.** The article was copied, but with a fallback. [Add a mapping](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=470&catid=118) or set a default.
- **A file that was skipped.** It is outside the media folders, too large, or of a type that is not accepted. See [Images, documents and media](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=471&catid=118).
- **A custom field that is not synced.** The field does not exist here, or has another type. See [Custom fields](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=472&catid=118).
- **Content filtering or SSL verification is switched off.** A reminder that you chose a less safe setting.

An error means an article could not be processed. The other articles of that run are still handled. [Troubleshooting](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=479&catid=118) lists the errors you are most likely to meet.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/dry-run-and-logging.md)

## Joomla 5 and Joomla 6

ContentSync runs on Joomla 5 and on Joomla 6. But the two versions do not hand over the same information about an article. That makes a difference you should know about before you start.

## It is the source site that counts

ContentSync asks the source site for its articles. What it gets back is decided by the Joomla version of that source site. The site that receives the articles, where the plugin is installed, can be Joomla 5 or Joomla 6. That makes no difference.

## Intro text and full text

In Joomla an article has two parts: the intro text, and the full text that comes after the **Read More** break. A blog page shows the intro text with a Read More button, and the article page shows both.

### Source site on Joomla 5

Joomla 5 hands over the two parts joined together as one text. The Read More break is not in it.

So ContentSync cannot tell where the intro ends. The whole article lands in the intro text on the target site, and the full text stays empty. The article is complete, but it has no Read More break any more. On a blog page the whole text is shown.

### Source site on Joomla 6.2 or newer

Joomla 6.2 hands over the intro text and the full text separately. ContentSync puts each in its own place, and the Read More break is exactly where the author put it.

### What to do with a Joomla 5 source

- If the target site shows articles in full, you do not have to do anything.
- If the target site shows a blog with intro texts, let the blog layout cut the text for you, or show only the title and the intro image there.
- Or update the source site to Joomla 6.2. After that, switch on **Force Resync** for one run and every article gets its break back.

## The full list

| What | Source on Joomla 5 | Source on Joomla 6.2 or newer |
| --- | --- | --- |
| Articles created and updated | Yes | Yes |
| Images, documents and media | Yes | Yes |
| Filters on category, tag, language, state and featured | Yes | Yes |
| Mapping of categories, tags, authors and access levels | Yes | Yes |
| Custom fields | Yes | Yes |
| Removed articles handled | Yes | Yes |
| Intro text and full text kept separate | No, one text | Yes |
| Filter on workflow stage | No | Yes |
| Incremental sync | No | Yes |
| Schema.org data | No | Yes |
| Custom fields of the type media file | No | Yes |

A source on Joomla 6.0 or 6.1 is expected to behave like a Joomla 5 source for the last five rows.

## What happens when you use a 6.2 option with an older source

Nothing breaks. The older source simply ignores what it does not know.

- **Workflow Stage:** the filter is ignored, so articles from every stage are copied. That can be more than you wanted, so leave it at 0 with an older source.
- **Incremental Sync:** the source hands over every article each time. The run still works, but it is not quicker, and removed articles are not handled in an incremental run. Leave it off with an older source.
- **Sync Schema.org Data:** there is nothing to copy.

## Mixing versions

Any combination works: Joomla 5 to Joomla 6, Joomla 6 to Joomla 5, or the same version on both sides. Look at the source to know what you get.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/joomla-5-and-joomla-6.md)

## Free and PRO

ContentSync comes in two editions. The free edition copies one kind of content to one place. PRO is for sites that are organised differently from each other, or that have more to carry over than text and images.

## Side by side

| What | Free | PRO |
| --- | --- | --- |
| Create and update articles on a schedule | Yes | Yes |
| One target category | Yes | Yes |
| Filter on publication state | Yes | Yes |
| Filter on source category | One category | Several categories |
| Images mirrored | Yes | Yes |
| Dry run and force resync | Yes | Yes |
| Logging | Yes | Yes |
| Article HTML filtered, files checked, safe access levels | Yes | Yes |
| Videos and other embeds from hosts you allow | Yes | Yes |
| Large syncs spread over several runs | Yes | Yes |
| Filters on tag, language, featured and workflow stage |  | Yes |
| Mapping of categories, tags, authors and access levels |  | Yes |
| Custom fields |  | Yes |
| Documents, audio and video |  | Yes |
| More media folders and your own file size limit |  | Yes |
| Removed articles handled |  | Yes |
| Incremental sync |  | Yes |
| Schema.org data |  | Yes |
| Rewrite relative links |  | Yes |
| Links between articles point at the local copies |  | Yes |
| Updates | Yes | Yes, with a license |
| Support |  | Yes, with a license |

## Security is not a PRO feature

Everything that protects your site is in both editions: the HTML filter, the checks on files, the limit to the media folders, and the careful handling of access levels. See [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).

## What you see in the free edition

The task form of the free edition shows the PRO options as a green badge, with a short explanation of what the option does. They cannot be switched on. A notice at the top of the form links to the PRO edition.

## Is the free edition enough for you?

It is, when:

- you copy articles from one category, or from the whole site;
- they all go into one category on the target site;
- the articles only use the access levels Joomla installs, such as Public and Registered;
- text and images are all there is to carry over.

You want PRO when articles have to keep their own category, author or tags, when they have custom fields or downloads, or when the target site should follow the source when an article is removed.

## Going from Free to PRO

1. Download the PRO zip from your account on joomill-extensions.com.
2. Install it over the free edition, under **System \> Install \> Extensions**. Do not remove the free edition first.
3. Enter your download key under **System \> Update \> Update Sites**, in *Joomill ContentSync plugin*, so updates keep arriving.

Your tasks keep all their settings. A list of categories you typed into the free edition, of which only the first was used, is used in full from then on. The list of articles that were already copied stays as well, so nothing is copied twice.

## Going back to Free

You can install the free edition over PRO. The PRO settings stay in your task, but the free edition does not read them. It works with its own defaults, as if those settings were off.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/free-and-pro.md)

## Security

ContentSync brings content from one site into another. The articles are written by other people, on a site you may not manage yourself. So the plugin does not simply trust what it receives. Everything in this article is in both the free and the PRO edition.

## Article HTML is filtered

An article can contain more than text. Somebody who can edit articles on the source site could put a script in one, and without a filter that script would run on your site, for your visitors and for you as an administrator.

With **Filter Article HTML** on, which is the default, ContentSync removes scripting from the article before it is stored: script tags, frames, embedded objects, forms and the attributes that run code. Normal text, images, links, tables and layout stay as they are.

The filter also covers the title, which keeps no markup at all, and the addresses in Link A, B and C and in the intro and full article image. There only web addresses, e-mail and phone links and paths are kept. A `javascript:` address is emptied.

The same filter is applied to textarea and editor custom fields.

Only switch the filter off when you fully control the source site and everyone who writes there, and when your articles really need something the filter removes. The log reminds you on every run that it is off.

### Videos and other embeds

The filter removes frames, and a YouTube or Vimeo video is a frame. So embeds from the hosts in **Allowed Embed Hosts** are kept: by default YouTube, youtube-nocookie and Vimeo. An embed is only kept when it loads over `https://`, and it is rebuilt with its address and a few layout attributes such as the width and height. Anything else in it, such as an attribute that runs code, is dropped.

Add a host when your articles embed something else, for example a map or a podcast player. Add only hosts you trust: an embed shows whatever that host serves.

## Files are checked before they are written

A file that is downloaded from the source ends up on your web server. That is the place where a wrong file does the most damage, so every file goes through these checks:

- **Only known types.** Images, and in PRO a fixed list of document, audio and video types. Nothing that a web server runs as a program, and no SVG.
- **The content has to match the name.** A file that calls itself a JPG has to be a JPG.
- **No PHP code.** A file that contains PHP is refused, whatever it calls itself.
- **Only inside the media folders.** A path that tries to climb out of them is refused.
- **A size limit.** A file that is too large is skipped.

These checks cannot be switched off. A file that fails is skipped, and the log says why. The article itself is still copied.

## Access levels are never guessed open

An access level decides who may read an article. Its number is different on every site, so copying the number could show a members-only article to everyone.

ContentSync only carries over the levels Joomla installs itself, which are the same everywhere. For a level you created yourself that is not mapped, it uses the most restrictive level of your site, or skips the article. It never picks a level that visitors can see. See [Categories, tags, authors and access levels](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=470&catid=118).

## The connection

**Verify SSL Certificate** is on by default. It makes sure the target site is really talking to your source site and not to something in between.

Only switch it off on a local or staging network you trust. With verification off, someone on the network path could pretend to be the source and feed content into your site. The log reminds you on every run.

Use an `https://` address for the source site. The API token travels with every request, and over `http://` anyone on the network path could read it. A run with an `http://` address therefore stops, unless you switch on **Allow http Source**. Only do that for a source you reach over a network you trust, such as a local test site. The log reminds you on every run.

When the source answers with a redirect, ContentSync only follows it to the source site itself. A redirect to another address is not followed, for the API and for file downloads alike. That way the token never goes to another site, and the source cannot make your server fetch something elsewhere.

ContentSync uses the Joomla HTTP layer, so a proxy you set in the Global Configuration is used for the connection to the source.

## The API token

- The token is a password for the source site. Treat it like one.
- Make a separate user on the source for the sync. Then you can switch the sync off by disabling that user or its token, without touching anyone else.
- The token is stored in the task on the target site. The field is masked and locked, so it is not shown on screen or offered by the browser to fill in elsewhere. Everyone who may edit scheduled tasks there can still unlock and read it.
- The token is not written to the log.

## Who can start a run

A run is started by the Joomla Task Scheduler. With the scheduler's *Lazy Scheduler* on, which is the Joomla default, a visit to your site can trigger a task that is due. That is normal Joomla behaviour and nothing a visitor can steer: they cannot choose the source, the settings or the moment.

## Found something?

If you think you found a security problem in ContentSync, please tell us through the [contact page](https://www.joomill-extensions.com/contact) before you make it public.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/security.md)

## Frequently asked questions

## Does ContentSync sync in both directions?

No. Articles go one way, from the source site to the site the plugin is installed on. The source is the original.

## Do I have to install anything on the source site?

No. ContentSync reads the source through the Joomla Web Services API, which is part of Joomla. You only create an API token there. [Your first sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=466&catid=118) shows how.

## Can the two sites run different Joomla versions?

Yes. The target site needs Joomla 5 or 6. What can be copied depends on the version of the source site. The main difference: a Joomla 5 source hands over the intro and full text as one text. See [Joomla 5 and Joomla 6](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=475&catid=118).

## What happens when I edit a copied article on the target site?

Your change stays until that article changes on the source. Then the copy is overwritten with the source version. Edit on the source.

## What happens when I delete an article on the source?

In the free edition the copy stays where it is. In PRO you choose: move it to the trash, unpublish it or delete it permanently. See [Removed articles and incremental sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=473&catid=118).

## How often does it run?

As often as you tell the Joomla Task Scheduler. Once an hour suits most sites. A run where nothing changed is quick, because unchanged articles are skipped.

## Can I sync from more than one site?

Yes. Add the task once for every source site. You can also add it several times for the same source, for example one task per category.

## Can I sync to more than one site?

Yes. Install ContentSync on every site that should receive the articles. They can all read from the same source, with the same token or each with its own.

## Does it copy categories, menus or users?

No. It copies articles, with their images and, in PRO, their tags, custom fields and files. The categories, tags, fields and users have to exist on the target site. ContentSync connects to them, it does not create them.

## Does it work with multilingual sites?

An article keeps its language. In PRO you can limit a task to certain languages. The links between translations, which Joomla calls associations, are not copied.

## What about articles that are already on both sites?

ContentSync only knows the articles it copied itself. An article that you copied by hand earlier is not recognised as the same one. When an article with the same alias already exists in the target category, the copy gets the alias with a number added and your existing article is left alone. Do you want ContentSync to take over those existing articles instead? Switch on **Take Over Articles With the Same Alias**. From then on the source updates them.

## Do videos in the articles survive?

Yes. YouTube and Vimeo embeds are kept by default, also with the HTML filter on. You can add other hosts under **Allowed Embed Hosts**. See [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).

## Are the images copied or only linked?

Copied. The images of an article are downloaded to the target site, in the same folders. The copy does not depend on the source site to show its pictures. See [Images, documents and media](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=471&catid=118).

## Is it safe to sync from a site I do not manage?

That is what it is built for. Scripting is filtered out of the text, files are checked before they are written, and an article with an unknown access level is never shown to everyone. See [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).

## What is the difference between Free and PRO?

The free edition copies articles and images into one category. PRO adds filters, mappings, custom fields, documents and the handling of removed articles. The full table is in [Free and PRO](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=476&catid=118).

## Do I lose my settings when I go from Free to PRO?

No. Install PRO over the free edition. Your tasks keep their settings, and nothing is copied twice.

## Does it slow my site down?

Not for visitors. The work happens in the scheduler, in the background. A first run on a large site takes a while, because every article and image is new. With **Maximum Run Time** such a sync is split into parts of two minutes by default, which the scheduler runs one after the other. After that a run only handles what changed.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/frequently-asked-questions.md)

## Troubleshooting

Start with the log. Set **Log Level** to *Debug* in your task, run it once, and read `administrator/logs/contentsync.php` from the bottom up. Most problems name themselves there. [Dry run and logging](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=474&catid=118) shows where everything is.

## API authentication failed (HTTP 401)

The source site does not accept the token. Check these, in this order:

1. **Is the token from the source site?** This is the most common mistake: a token made on the target site. A token only works on the site where it was created.
2. **Is the token active?** Open the user on the source site, tab **Joomla API Token**. *Active* has to be Yes.
3. **May this user use the API?** By default only Super Users may. That is a setting of the plugin *API Authentication - Web Services Joomla Token* on the source site.
4. **Is the whole token there?** Copy it again. A space at the start or the end is enough to break it.
5. **Are the plugins on?** On the source site: *API Authentication - Web Services Joomla Token*, *User - Joomla API Token* and *Web Services - Content*.

Some servers remove the token from the request before Joomla sees it. If everything above is right, ask the hosting company of the source site whether custom request headers are passed on.

## The source URL uses http://

The run stops because the API token would travel unencrypted. Use the `https://` address of the source. If the source really has no https, for example a local test site, switch on **Allow http Source**. See [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).

## Redirected to another host, which is not followed

The source answered with a redirect to another address, and ContentSync only follows redirects on the source site itself. This often means the **Source Site URL** is not the final address of the site: with or without `www`, or `http` instead of `https`. Open the address in your browser, see where it ends up, and use that address in the task.

## Source URL or API key is not configured

One of the two fields is empty in the task. Open the task, fill in both and save.

## Cannot reach source API

The target site got no usable answer from the source.

- Check **Source Site URL**. It is the address of the site itself, for example `https://www.example.com`, without `/administrator` or `/api`.
- Open `https://www.example.com/api/index.php/v1/content/articles` in your browser, with your own address. A message about being forbidden is good news: the API is there. A page not found means the API is not reachable at that address.
- Is the source behind a login, a firewall or a maintenance page? The target server has to be able to reach it.
- A certificate error on a local or staging site: see **Verify SSL Certificate** in [Security](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=477&catid=118).

## The task says it failed to run

The scheduler shows this when the task stopped before it started syncing. The real reason is in the ContentSync log: usually one of the problems above.

## The run works, but no articles arrive

- Is **Dry Run** still on? A dry run creates nothing.
- Look at the filters. The default state filter only takes published articles. A category ID that does not exist on the source gives an empty result.
- Does the log say *skipped* for every article? Then they were copied before and have not changed. That is how it should be.
- Does the log say an article was skipped because of its view level? See [access levels](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=470&catid=118).

## The articles are there, but visitors cannot see them

Open one of the articles and look at its **Access**. If it says Super Users, the article had an access level of your own on the source that is not mapped, and it got the most restrictive level to be safe. Add the level to **Access Level Mapping** and run once with **Force Resync**.

Also check that the target category is published and has a menu item or a module that shows it.

## The whole article is in the intro text

The source site runs Joomla 5, which hands over the intro and full text as one. See [Joomla 5 and Joomla 6](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=475&catid=118).

## Images or files are missing

The log names every file that was skipped, with the reason.

- **Outside the allowed media folder.** The file is not in `images`, or in PRO not in one of your **Media Folders**. Add the folder in PRO.
- **A disallowed extension.** The file type is not on the list, for example an SVG or a ZIP.
- **Does not appear to be a valid file.** The content does not match the extension.
- **Larger than the limit.** Raise **Maximum File Size (MB)** in PRO.
- **Could not download.** The file is not reachable on the source, for example because it sits behind a login.

An image on another website is never downloaded. The article keeps showing it from there.

## Videos are missing from the articles

With **Filter Article HTML** on, an embed is only kept when its host is in **Allowed Embed Hosts** and it loads over `https://`. YouTube, youtube-nocookie and Vimeo are in the list by default. Add the host of your embeds, and run once with **Force Resync** to fix articles that were copied before.

## An article got an alias with a number, such as my-article-2

The target category already had an article with that alias, one ContentSync did not create. That article is left alone and the copy gets a free alias. If the existing article is in fact an older copy of the same article, switch on **Take Over Articles With the Same Alias** before the article is copied, or remove the older article.

## Only one category is synced

The free edition filters on one source category. If you entered a list, the first one is used and the log names the rest. PRO takes the whole list.

## Custom fields stay empty

- The field has to exist on the target site, with the same name and the same type. The log says which one is missing.
- The field has to be published on both sites.
- Articles that were copied before only get their fields after one run with **Force Resync**.
- Does the log say the fields of the source could not be read? Then the user of the token has no access to Fields on the source site.

More in [Custom fields](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=472&catid=118).

## The log says orphan removal was skipped

Removed articles are only handled after a complete run. The message says why this run was not: a batch could not be fetched, the run had an error, or the sync was spread over several runs because of **Maximum Run Time**. See [Removed articles and incremental sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=473&catid=118).

## Copies disappeared after I changed a filter

With **Handle Deleted Articles** on, an article that no longer passes the filter counts as removed. With the default action the copies are in the trash of the target site, and you can restore them there. See [Removed articles and incremental sync](https://www.joomill-extensions.com/index.php?option=com_content&view=article&id=473&catid=118).

## The run stops halfway or times out

- Check **Maximum Run Time**. With the default of 120 seconds a long sync stops by itself and continues in the next run, which the scheduler starts straight away. The log says *\[RESUME\]* when that happens. If your server stops PHP sooner than that, lower the setting.
- Lower **Batch Size**, for example to 10. The run only stops between batches, so a smaller batch lets it stop closer to the time limit.
- Raise **Request Timeout** when the source is slow to answer.
- A first run with many images is the heaviest. Run the task a few times. It continues where it left off, because everything that was copied is skipped.

## Still stuck?

Send us the last run from `administrator/logs/contentsync.php` through the [contact page](https://www.joomill-extensions.com/contact), with the Joomla version of both sites. The log does not contain your API token.

[Read more...](https://www.joomill-extensions.com/documentation/contentsync/troubleshooting.md)

## Changelog



[Read more...](https://www.joomill-extensions.com/documentation/contentsync/changelog.md)

