Skip to main content

Administrating MarkLogic Server

Attaching and/or Detaching Forests to/from a Database

To query content in a forest, the forest must be attached to a database. Forests can be moved from one database to another (detached from one database and attached to another). Detaching a forest from a database does not delete the forest; the forest remains on the host on which it was created with the data intact. Forests can be moved from one database to another (detached from one and attached to another). However, before you attach the forest to another database, ensure that the new database has the same configuration as the old database. If the configuration of the new database is different and the reindex enable setting is set to true on the new database, the forest will begin reindexing to match the database configuration as soon as it is attached.

Note

If you attach a new forest to a database that makes use of the journal archiving feature described in Backing Up Databases with Journal Archiving, the forest will not participate in journal archiving until the next time the database is backed up. For details on how to do an immediate backup of a database, see Backing Up a Database Immediately.

You can also attach and detach forests from databases using the Forest Summary page, as described in Attaching and Detaching Forests Using the Forest Summary Page.

In the Admin Interface, follow these steps to attach or detach one or more forests to a database:

  1. Click Databases in the left tree menu

  2. Under Databases, click the name of the database.

  3. Click Forests.

  4. On the Configure Forests In A Database screen, check the box corresponding to the forest(s) you want to attach to the database. You can also uncheck forests you want to detach from the database.

  5. Click OK.

The forests you attached or detached are now reflected in the database configuration. Attaching and detaching a forest to a database are “hot” admin tasks.