Documentation: ContentSync plugin
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.
- 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.
- Open the tab Joomla API Token.
- Set Active to Yes and save. The token appears in the field. If the field is empty, save the user once more.
- 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.
- Go to System > Manage > Scheduled Tasks and click New.
- Choose Content Sync: Synchronise Articles.
- Give the task a title you will recognise, for example News from example.com.
- Under Source Site URL, enter the address of the source site, for example
https://www.example.com. - Under API Key (Token), paste the token.
- 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.
3. Do a dry run
Before anything is written, look at what the task would do.
- Set Dry Run (Preview) to Yes and save the task.
- In the task list, click the Run Test button of your task.
- 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 shows where to read the details.
Do you get an error instead? Troubleshooting 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 explains this in more detail.