This page applies to single-node, unclustered systems.
For clustered system restore, see Backup and Restore.
The Attivio Platform can be configured to make backups of the index periodically by running a system command via a Backup Service. The Backup Service guarantees that the backup command is executed within the context of a commit so the Attivio index is in a known and consistent state. In addition, backups can also be scheduled on a periodic basis so that they can run during off-peak usage times.
The backup mechanism consists of copying the Attivio index directory tree to another location using rsync (Linux), robocopy (Windows) or a script/executable specified by the user.
These features require that the indexbackup module be included when you run createproject to create the project directories.
Why not just back up the data-agent directory?
The Attivio index is a complex, multi-part system subject to constant updates. The most recently-ingested documents are in memory but have not been written to the disk yet. Simply copying the data files at an arbitrary moment does not capture a consistent and complete view of the index. The Attivio Backup Service commits recent changes and puts the indexes into a restorable state before copying them.
In many cases it is useful to use a property value as a source or destination for backup operations. In order to ensure that the correct path separators (forward vs back slash) the $PATH property evaluator can be used in configuration files.
Using the indexbackup Module
The indexbackup module is comprised of two separate services that can be used to manage backing up of a live index when desired. In order to use these two services, a backup connector and a backup service must be configured to match the operating system's backup commands and the Attivio index configuration. See the configuration samples below for more details.
BackupService is designed to run the system command (
robocopy, etc.) used to perform the backup. The backupService is a normal service that is also configured as a notification endpoint for an index engine. When the AttivioEngine receives a Backup message from a backup connector, the engine will notify the Backup Service to run the backup command once the engine has finished handling the backup message.
Environment Variables for Backup Service Configuration
Attivio sets three backup-related environment variables which can be referenced in your Backup Service configuration. When a backup is run, these environment variables will be replaced with the values shown below for each index partition being backed up:
The path to the index partition's data directory, used as the source directory for
The name of the index partition's engine, used to construct backup destination directory paths.
The name of the index partition being backed up, used to construct backup destination directory paths.
By abstracting out the settings that are partition-specific, these variables enable you to configure an
robocopy command that will work correctly for all master index partitions.
Example Linux Configuration
Create a new configuration file in the
<project-dir>/conf/components directory. It can have any name, but we recommend an intuitive name such backupService.xml. Insert the following example content into the file, replacing
<PATH> with appropriate values for the server to which you want the backup to be written (e.g., replace <HOST> with
myAttivioBackupHost and <PATH> with
Note that on some systems, the full path to the command used by the backup service may need to be specified. For example, on a Linux system, specifying the following may be required:
Example Windows configuration
Create a new configuration file in the
<project-dir>\conf\components directory. It can have any name, but we recommend an intuitive name such as backupService.xml. Insert the following example content into the file:
Note that robocopy requires the /MIR switch to prevent obsolete segment files from accumulating in the destination directory.
Once the Backup Service component is defined, an Attivio service must be defined (in the <PROJECT-DIR>/conf/services.xml file) so that that the Backup Service gets started with Attivio.
If you want to run a backup service for multiple index features, you will need to create multiple backup service components (one for each index feature you want to backup).
- The script or process run in order to perform a backup should be synchronous such that when the command is finished, the complete backup process is finished and all files being read from the index directory have completed.
- On Linux hosts, the user account under which the node/engine is running must have the execute permission on the backup script/command.
Note that a Backup Connector is not a stand-alone mechanism. The connector simply sends a Backup message to the Attivio Backup Service via a workflow. The Backup Service must be configured (as shown above) before the Backup Connector can function.
The BackupConnector is a connector that can be scheduled to send a Backup message through an ingest workflow in order to trigger a Backup. This connector takes an option to force a commit prior to performing the backup. This connector can be scheduled to run via the normal connector scheduling mechanisms. This allows backups to run via a policy such as "Run backup at 2am every weekday" and so on.
To create a Backup Connector, navigate to the Connectors page of the Use the Attivio Administrator and click the New link. Select Backup Connector from the New Connector dialog box. A connector editor will open.
Give the connector a name. To bypass most ingestion stages and reduce overhead for the connector, you can change the default ingest workflow to indexer.
Note that the editor's Scheduler tab lets you trigger a backup event on a regular schedule (see below).
Triggering a Backup
Manually, via Connector
Via the Scheduler
You can configure a schedule for the Backup Connector in the Scheduler tab of its editor to run backups on a timed basis. See "Scheduling Connectors" in the Scheduling Tasks page for more details on scheduling the connector.
Programmatically, via Java SDK
Attivio provides Java APIs that allow users to trigger a backup. The solution involves creating a Java executable using the Attivio APIs which can be run from the command line. The executable can be written to return a success or failure signal.
The relevant Javadoc is located at https://attivio.github.io/sdk-5.5-javadoc/com/attivio/sdk/client/ConnectorControlApi.html.
The following page has examples of using the
ServiceFactory from within and outside Attivio:
While connectors are running, users can monitor for System Events using https://attivio.github.io/sdk-5.5-javadoc/com/attivio/sdk/event/EventQuery.html
Restoration of a backed-up Attivio index in a single-node system requires these steps:
- Ensure the the system is not ingesting content.
- Navigate to the Indexes page from the Admin UI.
- Delete the Index. A confirmation dialog will open, type "index" into the text box and click okay.
- Shut down Attivio. This lets you overwrite the index files.
- Remove the index directory from the Project Index Directory, for example:
- Copy the contents of the Backup Directory Index created by the backup into the Project Index Directory
- Restart Attivio.
- Navigate back to the Indexes page in the Admin UI and verify that the index reflects the rollback.
- Reload any sources that were ingested after the date of the backup.