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. |
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
In the default configuration of the Fess zip/tar.gz distribution, OpenSearch starts on port 9201 (search_engine.http.url in fess_config.properties). For RPM/DEB packages, the default configuration connects to port 9200 (SEARCH_ENGINE_HTTP_URL in the environment configuration file /etc/sysconfig/fess (RPM) or /etc/default/fess (DEB)). Adjust the port number to match your environment.
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 only Fess-related indexes (indexes starting with fess).
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
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/tar.gz | System configuration (general settings) |
/etc/fess/system.properties | RPM/DEB | System configuration (general settings) |
app/WEB-INF/classes/fess_config.properties | zip/tar.gz | Detailed Fess configuration |
/etc/fess/fess_config.properties | RPM/DEB | Detailed Fess configuration |
app/WEB-INF/classes/log4j2.xml | zip/tar.gz | Log configuration |
/usr/share/fess/app/WEB-INF/classes/log4j2.xml | RPM/DEB | Log configuration |
app/WEB-INF/classes/fess_indices/ | zip/tar.gz | Index definition files |
/usr/share/fess/app/WEB-INF/classes/fess_indices/ | RPM/DEB | Index definition files |
app/WEB-INF/thumbnails/ | zip/tar.gz | 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.
Restore indexes from the snapshot.
After restoring, verify that the
fess.searchandfess.updatealiases point to the restored index.
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.
Cannot Search After Restore
Verify that indexes were restored correctly:
curl -X GET "localhost:9201/_cat/indices?v"Verify that the
fess.searchandfess.updatealiases point to the restored index:curl -X GET "localhost:9201/_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.