Overview
Data handled by Fess is managed as OpenSearch indexes. Backup and restore of search indexes is essential for stable system operation. This section explains index backup, restore, and migration procedures using OpenSearch’s snapshot functionality.
Note
In addition to the OpenSearch snapshot-based index backup described in this section, Fess also provides a feature to export/import configuration information (crawl configuration, user information, system settings, etc.) from the administration screen. If you only need to back up or migrate configuration information, refer to Backup. OpenSearch snapshots are suited for physically backing up entire indexes including search documents.
Index Structure
Fess uses the following indexes:
| Index Name | Description |
|---|---|
fess.{timestamp} | Search document index. Created in fess.{yyyyMMddHHmmssSSS} format (millisecond-precision timestamp) when the index is rebuilt, and referenced via the fess.search (for searching) and fess.update (for updating) aliases. |
fess_config.* | System configuration (composed of multiple sub-indices such as fess_config.web_config, fess_config.scheduled_job, fess_config.data_config, etc.) |
fess_user.* | User information (fess_user.user, fess_user.role, fess_user.group) |
fess_log.* | Search logs, click logs, etc. (fess_log.search_log, fess_log.click_log, fess_log.favorite_log, fess_log.user_info, fess_log.notification_queue) |
fess_crawler.* | Temporary indexes used during crawling (fess_crawler.queue, fess_crawler.data, fess_crawler.filter). These are not needed after crawling completes and generally do not need to be included in backups. |
configsync | Contents of the dictionary files (synonyms, stopwords, mappings, etc.). Managed by the OpenSearch configsync plugin, which writes them out as files under OpenSearch’s config/dictionary. The search document index and the suggest indexes refer to these files, so always include this index in backups. |
Warning
A snapshot contains indexes only; it does not contain the dictionary files under OpenSearch’s config/dictionary. If the configsync index is not backed up, the dictionary files do not exist when you restore onto a new OpenSearch, and fess.{timestamp} and fess_suggest_analyzer cannot be opened with IOException while reading ..._path: file not readable (the cluster status becomes red).
Index Backup and Restore
You can execute index backup and restore using OpenSearch’s snapshot functionality.
Snapshot Repository Configuration
First, configure a repository to store backup data.
For filesystem repository:
Add the repository path to the OpenSearch configuration file (
opensearch.yml).
Restart OpenSearch.
Register the repository.
Note
By default, Fess connects to OpenSearch on port 9200 (SEARCH_ENGINE_HTTP_URL in bin/fess.in.sh for the ZIP distribution, or in the environment configuration file /etc/sysconfig/fess (RPM) or /etc/default/fess (DEB) for the packages). Adjust the port number if your OpenSearch listens elsewhere.
For AWS S3 repository:
To use S3 as a backup destination, install and configure the repository-s3 plugin.
Creating Snapshots (Backup)
Backing Up All Indexes
Back up all indexes.
Backing Up Specific Indexes
Back up only specific indexes. The following example targets the Fess-related indexes (indexes starting with fess) and the configsync index that holds the dictionary files. Without configsync, the dictionary files cannot be restored.
Automated Periodic Backups
Periodic backups can be executed using cron or similar tools.
Checking Snapshots
Check the list of created snapshots.
Check details of a specific snapshot.
Restoring from Snapshots
Restoring All Indexes
Restore the configsync index and write out the dictionary files first, then restore the Fess indexes (fess*). Run the restore while Fess is stopped.
You cannot restore everything at once with "indices": "*". OpenSearch creates indexes such as configsync itself at startup, so even on a new OpenSearch the restore fails with cannot restore index [configsync] because an open index with same name already exists in the cluster. Restoring only fess* does not work either: without the dictionary files, fess.{timestamp} and fess_suggest_analyzer cannot be opened, the cluster turns red, and Fess started against it fails to start (every page returns 404).
Delete the empty
configsyncindex that the configsync plugin created at startup, and restoreconfigsyncfrom the snapshot.
Restart OpenSearch (every node in a multi-node cluster). Once the
configsyncindex is available, write the restored dictionaries out to OpenSearch’sconfig/dictionary.
Note
With configsync plugin 3.8.0 and earlier, _configsync/flush writes only the files registered after the node last started a write run (a scheduled run or _configsync/flush). The restored configsync files carry the times they were registered on the cluster the snapshot was taken from, so once the first scheduled write has run, about one minute after OpenSearch starts, running _configsync/flush without a restart writes no dictionary files and the cluster turns red after step 3. A restart resets that point, so _configsync/flush after the restart writes every dictionary file. For each file it writes, OpenSearch logs Updated {file path} from ConfigSyncService.
Restore the Fess indexes.
Confirm that the cluster status is
green(yellowif replicas cannot be allocated), then start Fess.
Note
When restoring over the same index names on a running cluster, the restore fails for any index that is open. Close (_close) the target indexes before step 3.
Restoring Specific Indexes
The search document index name is in the format fess.{yyyyMMddHHmmssSSS}. Verify the actual index name using _cat/indices or similar before restoring.
Restoring with Index Name Change
You can also change the index name when restoring.
Note
After restoring the search document index (fess.{timestamp}), always verify that the fess.search and fess.update aliases point to the restored index. Snapshots include alias information, so when all indexes are restored with their original names, aliases are typically restored as well. However, if you restored with a renamed index using rename_pattern, or migrated to a different cluster, aliases may not be configured correctly. In that case, manually reconfigure the aliases as shown below (replace the index name with the actual one).
Deleting Snapshots
You can delete old snapshots to save storage space.
Configuration File Backup
In addition to OpenSearch indexes, back up the following configuration files. The location of configuration files varies depending on the installation method.
Files to Back Up
| File/Directory | Installation Method | Description |
|---|---|---|
app/WEB-INF/conf/system.properties | ZIP | System configuration (general settings) |
/etc/fess/system.properties | RPM/DEB | System configuration (general settings) |
app/WEB-INF/classes/fess_config.properties | ZIP | Detailed Fess configuration |
/etc/fess/fess_config.properties | RPM/DEB | Detailed Fess configuration |
app/WEB-INF/classes/log4j2.xml | ZIP | Log configuration |
/usr/share/fess/app/WEB-INF/classes/log4j2.xml | RPM/DEB | Log configuration |
app/WEB-INF/classes/fess_indices/ | ZIP | Index definition files |
/usr/share/fess/app/WEB-INF/classes/fess_indices/ | RPM/DEB | Index definition files |
app/WEB-INF/thumbnails/ | ZIP | Thumbnail images (as needed) |
/var/lib/fess/thumbnails/ | RPM/DEB | Thumbnail images (as needed) |
Note
In the RPM/DEB package installation, the /etc/fess/ directory contains not only fess_config.properties but also other configuration files such as fess_env_crawler.properties and other fess_env_*.properties files, as well as tika.xml. It is recommended to back up the entire /etc/fess/ directory. The system.properties file is created and updated as /etc/fess/system.properties when settings are saved in the administration screen under “System > General”.
Configuration File Backup Example
The following is an example of backing up configuration files for the RPM/DEB package installation.
Data Migration
Migration Procedure to a Different Environment
Create Backup at Source
Create an OpenSearch snapshot.
Back up configuration files.
Prepare Destination
Install Fess in the new environment.
Start OpenSearch.
Restore Configuration Files
Copy the backed-up configuration files to the new environment.
Modify paths, hostnames, etc. as needed.
Restore Indexes
Configure the snapshot repository.
Following “Restoring All Indexes”, restore
configsyncand write out the dictionary files, then restore the Fess indexes.After restoring, verify that the
fess.searchandfess.updatealiases point to the restored index.Verify that the cluster status is
green(oryellow). If Fess is started while the cluster isred, it fails to start.
Verify Operation
Start Fess.
Access the administration screen and verify the configuration.
Verify that search functionality works correctly.
Version Upgrade Considerations
When migrating data between different Fess versions, note the following:
If OpenSearch major versions differ, compatibility issues may occur.
If the index structure has changed, reindexing may be necessary.
If you want to migrate configuration information across index structure changes, consider using the administration screen backup feature (Backup) for logical export/import rather than OpenSearch snapshots.
For details, refer to the upgrade guide for each version.
Troubleshooting
Snapshot Creation Fails
Check permissions for the repository path.
Verify that sufficient disk space is available.
Check error messages in OpenSearch log files.
Restore Fails
Verify that an index with the same name does not already exist. In OpenSearch, you cannot restore to an open index with the same name. Before restoring, either close (
_close) or delete the target index, or restore under a different name usingrename_pattern.Verify that the OpenSearch version is compatible.
Verify that the snapshot is not corrupted.
Cluster Is Red After Restore
If the cluster status is red after restoring fess* and you see the following, the dictionary files are missing.
_cluster/allocation/explainreportsIOException while reading mappings_path: file not readable(orkeywords_pathand so on)When Fess starts,
fess.logshowsFailed to initialize Lasta Di(aNullPointerExceptioninSuggestHelperinit) and every page returns 404
Neither _cluster/reroute?retry_failed=true nor putting the dictionary files in place recovers it: a shard that failed to restore is not allocated again until its index is closed or deleted and restored once more. Recover as follows.
Follow steps 1 and 2 of “Restoring All Indexes” to restore
configsync, restart OpenSearch, and write out the dictionary files.List the
redindexes.Close the
redindexes and restore them from the snapshot again (replace the index names with the actual ones).
Cannot Search After Restore
Verify that indexes were restored correctly:
curl -X GET "localhost:9200/_cat/indices?v"Verify that the
fess.searchandfess.updatealiases point to the restored index:curl -X GET "localhost:9200/_cat/aliases?v". If aliases are not configured, reconfigure them using the_aliasesAPI.Check Fess log files for errors.
Verify that configuration files were restored correctly.
References
For detailed information, refer to the official OpenSearch documentation.