#306: How to Migrate/Synchronize Articles Between Two Swarmica Installations
Отредактирована: сегодняIn this article, instructions for migrating/synchronizing articles between two Swarmica installations are described.
Instructions
Preparation
-
Log in to the source (where the articles are migrated from) Swarmica as Administrator
-
Create an API token in Settings - API and Integrations
-
Log in to the target (where the migration is) Swarmica as Administrator
-
Create a script in Settings - Scripts with the Administrator role

- Add the script onetime_hc_migration.py and the following web form:
[
{
"name": "host",
"type": "string",
"required": true,
"displayName": "URL (host)"
},
{
"name": "token",
"type": "string",
"required": true,
"displayName": "API token"
},
{
"name": "published",
"type": "boolean",
"required": false,
"displayName": "Published"
},
{
"name": "draft",
"type": "boolean",
"required": false,
"displayName": "Draft"
},
{
"name": "archived",
"type": "boolean",
"required": false,
"displayName": "Archived"
},
{
"name": "approved",
"type": "boolean",
"required": false,
"displayName": "Approved"
},
{
"name": "unapproved",
"type": "boolean",
"required": false,
"displayName": "Unapproved"
},
{
"name": "refresh_migrated",
"type": "boolean",
"required": false,
"displayName": "Overwrite existing articles"
}
]
and click Save.
It should look like this:

Starting the migration/synchronization
In the URL (host) field, enter the URL of the source Swarmica (example: https://source.swarmica.tld), in the API token field, enter the token from step 2, select the statuses of the articles to be migrated (if none of the statuses are selected, only published articles will be migrated). If you need to synchronize already migrated articles, enable the Overwrite existing articles parameter and click Send.