Backing up the Search index using wsadmin commandsAdded by IBM on February 11, 2013 | Version 1 (Original)
|Use SearchService administrative commands to define scheduled backup tasks for the Search index.
Before you begin
To use SearchService administrative commands, you must use the wsadmin client. See Starting the wsadmin client
for information about how to start the wsadmin command-line tool.
Backups are written to the location specified in the IBM WebSphere
® Application Server environment variable, SEARCH_INDEX_BACKUP_DIR.
To back up the Search index, complete the following tasks.
Parent topic: Backing up the Search index
Restoring the Search index
Backing up the Search index manually
Restoring a Search index in a single-node environment
Restoring a Search index without restarting individual nodes
Restoring a Search index in an environment with multiple nodes
- Start the wsadmin client from the following directory of the system on which you installed the Deployment Manager:
is the WebSphere
Application Server installation directory and dm_profile_root
is the Deployment Manager profile directory, typically dmgr01.
You must start the client from this directory or subsequent commands that you enter do not execute correctly.
- After the wsadmin command environment has initialized, enter the following command to initialize the Search environment and start the Search script interpreter:
If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, you must pick the node where the file is stored.
When the command is run successfully, the following message displays:
Search Administration initialized
- Use the following commands.
SearchService.addBackupIndexTask(String taskName, String schedule, String startbySchedule)
Defines a new scheduled index backup task.
This command takes the following arguments:
- taskName. The name of the task to be added.
- schedule. The time at which the scheduled task starts. This argument is a string value that must be specified in Cron format.
- startbySchedule. The time given for the task to run before it is automatically canceled. This argument is a string value that must be specified in Cron format.
SearchService.addBackupIndexTask("WeeklyIndexBackup","0 0 2 ? * SAT","0 10 2 ? * SAT")
When the command runs successfully, 1 is printed to the wsadmin console. If the command does not run successfully, 0 is printed to the wsadmin console.
Backs up the index to the location specified by the IBM WebSphere Application Server variable, SEARCH_INDEX_BACKUP_DIR. There might be a delay before the backup occurs if there are indexing tasks in progress.SearchService.deleteTask(String taskName)
This command does not take any arguments.
After backing up the Search index using wsadmin commands, consider performing a full backup of the HOMEPAGE database. Note that the Search index has a dependency on data in the HOMEPAGE database.
Deletes the specified backup task.
This command takes a single argument:
- taskName. The name of the task to be deleted.
Brings the database to a consistent state so that crawlers start from the point at which the backup was made.
The notifyRestore command updates index management tables in the HOMEPAGE database so that crawling resume points are reloaded from a restored index, thereby ensuring that all future crawls start from the correct point. The command also purges cached content in the HOMEPAGE database.
The notifyRestore command optionally removes all entries from the HOMEPAGE database table that tracks the status of individual files as part of the content extraction process. This table is used by the Search application when indexing the content of file attachments.
This command takes a single parameter:
- isNewIndex: If set to true, all entries are removed from the database table that is used by the file content extraction process to track the status of individual files.
Set this parameter to true when you are restoring a newly-built index. Set the parameter to false when you are restoring an index backup.