Search code examples
marklogic

How to restore a ML content db from single node to a 3-node-cluster


I have a single-node ML dev environment. I already took a db backup. My objective is to restore that db backup to a 3-node ML Cluster for qa.

In order to make the db set up the same, I have already retired the content -2 and content-3 db. Hence in 3-node ML cluster there is only one content forest same as the single-node dev environment.

However, I could see some strange messages like below.

Moreoever I do not expect to see is-data-dir message next to the db.

Here is the error message after clicking restore.

Restore Error Messsage

FYI:

  1. I did try to restore the very same db backup on another single node ML successfully.
  2. In the past I did successfully do the same things before but it is the reverse way. I restore a DB back from a 3 node cluster to a single node. The trick I did last time is to create three content forests on that single node.
  3. Both dev and qa are based on the same ML version.

Solution

  • It appears that you are pointing to a directory that is not a backup directory. MarkLogic backup directories will start with a dateTime of when the backup was taken and will look something like: 20230529-1837423059969.

    Maybe you are pointing to the parent directory of where a backup was taken?

    is-data-dir is indicating that the directory is a MarkLogic data directory.

    It's generally a good idea to put your backups in an area that is separate from the forest data. When you see that, it makes me question if this is a backup location, or if it is - whether you had copied the backup folders to /var/opt/MarkLogic/ml-backups. You should put your backups in a different location.

    If you attempt to create a backup inside of the MarkLogic data directory, you will get an error: XDMP-BACKDATADIR. The error page explains that it's a bad idea to put your backups there:

    The configured backup directory is the same as, or is a sub-directory of, MarkLogic's data directory.

    Your backup directory may not be inside the MarkLogic Server installation or data area. For example, on Unix, you should not save your backups under /var/opt/MarkLogic or /opt/MarkLogic.