Search code examples
marklogic

What is the difference for MarkLogic backup / restore db vs MLCP export/import with Archive type?


  1. MLCP export and import with archive type could be used for DB backup and restore. In the archive file, it contains document other metadata data like permissions/collections/properties etc.

  2. Without MLCP, one could also do the DB backup and restore from ML Admin Interface.

Compare these two approaches, what is the difference, and what are the use case for each?

Since MLCP is independent of ML architecture, does it mean One could use MLCPto archive backup a DB from windows based ML and restore the archive backup to a Linux based ML?

I could not find any ml-gradle tasks for ML DB backup and restore tasks. Why they are not covered in ml-gradle? (Currently, I am using data movement tasks from ml-gradle to archive the db.)


Solution

  • The export capability in mlcp supports many different scenarios, and one that you could use it for would be creating a human-readable backup of all of your documents so that they could be imported into another database, stored in S3, etc. But if your use case is simply to generate backups of a database, it's far simpler to use the built-in database backup capability in MarkLogic as opposed to introducing a separate tool - particularly for gaining benefits like incremental backups.

    As for ml-gradle - you can configure backups on a database by adding the necessary configuration to your database JSON file. The ml-gradle docs describe the easiest way to do that - i.e. manually configure your desired settings via the Admin UI, and then use the Manage API to get the JSON for your configuration.

    Also, there's not yet a task in ml-gradle for backing up a database on demand. Such a task would need to support all the different arguments for backing up a database - e.g. mlBackupDatabase -Pdatabase=my-db -PbackupDir=/some/path -Pincremental=false etc etc etc. Most of the time, I think it'll be simpler to just write your Gradle task and specify your arguments via a JSON object.