Restoring data files from a snapshot

You can restore data files from an archived snapshot using the cpmdex command. The command copies files from the archived snapshot into the data files of the specific Endeca data store.

The Dgraph process bin directory contains cpmdex.cmd (Windows) and cpmdex.sh (Linux) versions of this command.

The cpmdex executable (cpmdex.cmd on Windows and cpmdex.sh on Linux) is located in:
$EndecaServerRoot/endeca-server/dgraph/bin

The cpmdex command takes as input both the path to the archived snapshot and the path to the data files of the Endeca data store that will be restored.

Important: Before running the cpmdex command, ensure that the version of the Endeca data files to which you are restoring from the snapshot matches the version of the data files from which the snapshot was captured. You can verify the version of the Endeca data store in the standard out log for the Dgraph process.

To restore the data files from a snapshot:

  1. Use the Endeca Server stop-ds command to stop the Endeca data store that are you are about to restore.
  2. From a command prompt, run the cpmdex command.
    An example on Windows is:
    cpmdex -a c:\backup\my_snapshot -m c:\apps\myapp\bikes
    An example on Linux is:
    $ cpmdex.sh -a mnt/backup/my_snapshot -m home/apps/myapp/bikes
  3. Start the Endeca data store with the Endeca Server start-ds command.

As a result, the old bikes_indexes data files directory is renamed to bikes_indexes.1 and the snapshot is copied under the bikes_indexes name.