This function moves data in a forest to new data
directories and optionally sets new host for the forest. If no data
directory is specified, the default data directory will be used.
For details, see Migrating Forests and Partitions in the Administrator's Guide.
Parameters
forest-ids
IDs of the forests to migrate.
new-host-id
ID of the destination host.
new-data-directory
The optional data directory of the forest. If no directory
is specified, then it will be a private forest.
new-large-data-directory
The optional directory where large objects are stored. If no directory
is specified, then large objects will be stored in
DATA_DIR/Forests/FOREST_NAME/Large.
new-fast-data-directory
The optional directory for the fast data directory for this forest.
The fast data directory is typically located on a fast storage device,
such as an SSD.
options
Valid option values include:
timeout=N
Specifies the number of seconds to wait for a forest to re-open after a
configuration is made during the migration operation.
local-to-local
Indicates that the migration is between local storage to local storage.
This is the default when no other direction parameter is specified and
the type of storage cannot be derived from either the data directory
path.
local-to-shared
Indicates that the migration is between local storage and shared
storage. This type of migration supports changing the host.
shared-to-local
Indicates that the migration is to move data from shared storage to
local storage. This type of migration supports changing the host.
shared-to-shared
Indicates that the migration is to move data from shared storage to
shared storage. This type of migration supports changing the host.
Example
// Moves the Forest1 from its current location to /tmp/test and sets their
// timeouts to 20 seconds.
const ts = require('/MarkLogic/tieredstorage');
ts.forestMigrate(
xdmp.forest('Forest1'),
xdmp.host('host1'),
'/tmp/test',
null,
null,
['timeout=20']);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.