Dumps

The dumps route allows the creation of database dumps. Dumps are .dump files that can be used to launch MeiliSearch. Dumps are compatible between MeiliSearch versions.

Creating a dump is also referred to as exporting it, whereas launching MeiliSearch with a dump is referred to as importing it.

During a dump export, all indexes of the current instance are exported—together with their documents and settings—and saved as a single .dump file.

During a dump import, all indexes contained in the indicated .dump file are imported along with their associated documents and settings. Any existing index with the same uid as an index in the dump file will be overwritten.

Dump imports must be performed when launching a MeiliSearch instance using the import-dump command-line option.

Create a dump

POST

  1. /dumps

Triggers a dump creation process. Once the process is complete, a dump is created in the dumps directory. If the dumps directory does not exist yet, it will be created.

MeiliSearch only processes one dump at a time. If you attempt to create a dump while another dump is still processing, MeiliSearch will throw an error. While a dump is processing, the update queue is paused and no write operations can occur on the database.

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

  1. curl -X POST 'http://localhost:7700/dumps'
  1. client.createDump()
  1. client.create_dump()
  1. $client->createDump();
  1. client.createDump();
  1. client.create_dump
  1. resp, err := client.CreateDump()
  1. client.create_dump().await.unwrap();
  1. self.client.createDump { result in
  2. switch result {
  3. case .success(let dumpStatus):
  4. print(dumpStatus)
  5. case .failure:
  6. print(error)
  7. }
  8. }
  1. await client.createDump();

Response: 202 Accepted

  1. {
  2. "uid": "20200929-114144097",
  3. "status": "in_progress",
  4. "startedAt": "2020-09-29T11:41:44.392327Z"
  5. }

Get dump status

GET

  1. /dumps/:dump_uid/status

Get the status of a dump creation process using the uid returned after calling the dump creation route.
The returned status could be:

  • in_progress: Dump creation is in progress
  • failed: An error occurred during dump process, and the task was aborted
  • done: Dump creation is finished and was successful

Example

<>

cURL

JS

Python

PHP

Java

Ruby

Go

Rust

Swift

Dart

  1. curl -X GET 'http://localhost:7700/dumps/20201101-110357260/status'
  1. client.getDumpStatus("20201101-110357260")
  1. client.get_dump_status('20201101-110357260')
  1. $client->getDumpStatus('20201101-110357260');
  1. client.getDumpStatus("20201101-110357260");
  1. client.get_dump_status(20201006-053243949)
  1. resp, err := client.GetDumpStatus("dump-uid")
  1. client.get_dump_status("20201101-110357260").await.unwrap();
  1. self.client.getDumpStatus(uid) { result in
  2. switch result {
  3. case .success(let dumpStatus):
  4. print(dumpStatus)
  5. case .failure:
  6. print(error)
  7. }
  8. }
  1. await client.getDumpStatus('20201101-110357260');

Response: 200 Ok

  1. {
  2. "uid": "20200929-114144097",
  3. "status": "done",
  4. "startedAt": "2020-09-29T11:41:44.392327Z",
  5. "finishedAt": "2020-09-29T11:41:50.792147Z"
  6. }