Exporting and importing dumps

    A dump is a compressed file containing an export of your Meilisearch instance. Use dumps to migrate to new Meilisearch versions. This tutorial shows you how to create and import dumps.

    Creating a dump is also referred to as exporting it. Launching Meilisearch with a dump is referred to as importing it.

    Creating a dump

    Creating a dump in Meilisearch Cloud

    You cannot manually export dumps in Meilisearch Cloud. To migrate your project to the most recent Meilisearch release, use the Cloud interface:

    The General settings interface displaying various data fields relating to a Meilisearch Cloud project. One of them reads "Meilisearch version". Its value is v1.6.2. Next to the value is a button "Update to v1.7.0"

    If you need to create a dump for reasons other than upgrading, contact the support team via the Meilisearch Cloud interface or the official Meilisearch Discord server.

    Creating a dump in a self-hosted instance

    To create a dump, use the create a dump endpoint:

    curl \
      -X POST 'http://localhost:7700/dumps'

    This will return a summarized task object that you can use to check the status of your dump.

    {
      "taskUid": 1,
      "indexUid": null,
      "status": "enqueued",
      "type": "dumpCreation",
      "enqueuedAt": "2022-06-21T16:10:29.217688Z"
    }
    

    The dump creation process is an asynchronous task that takes time proportional to the size of your database. Replace 1 with the taskUid returned by the previous command:

    curl \
      -X GET 'http://localhost:7700/tasks/1'

    This should return an object with detailed information about the dump operation:

    {
      "uid": 1,
      "indexUid": null,
      "status": "succeeded",
      "type": "dumpCreation",
      "canceledBy": null,
      "details": {
        "dumpUid": "20220621-161029217"
      },
      "error": null,
      "duration": "PT0.025872S",
      "enqueuedAt": "2022-06-21T16:10:29.217688Z",
      "startedAt": "2022-06-21T16:10:29.218297Z",
      "finishedAt": "2022-06-21T16:10:29.244169Z"
    }
    

    All indexes of the current instance are exported along with their documents and settings and saved as a single .dump file. The dump also includes any tasks registered before Meilisearch start processing the dump creation task.

    Once the task status changes to succeeded, find the dump file in the dump directory. By default, this folder is named dumps and can be found in the same directory as your Meilisearch binary.

    If a dump file is visible in the file system, the dump process was successfully completed. Meilisearch will never create a partial dump file, even if you interrupt an instance while it is generating a dump.

    API keys and backups

    Since the key field depends on the master key, it is not propagated to dumps. If a malicious user ever gets access to your dumps, they will not have access to your instance's API keys.

    Importing a dump

    Importing a dump in Meilisearch Cloud

    You can import a dump into Meilisearch when creating a new project, below the plan selector:

    The project creation interface, with a few inputs fields: project name, region selection, and plan selection. Right below all of these, is a file upload button named "Import .dump"

    Importing a dump in self-hosted instances

    Import a dump by launching a Meilisearch instance with the --import-dump configuration option:

    ./meilisearch --import-dump /dumps/20200813-042312213.dump
    

    Depending on the size of your dump file, importing it might take a significant amount of time. You will only be able to access Meilisearch and its API once this process is complete.

    Meilisearch imports all data in the dump file. If you have already added data to your instance, existing indexes with the same uid as an index in the dump file will be overwritten.

    NOTE

    Do not use dumps to migrate from a new Meilisearch version to an older release. Doing so might lead to unexpected behavior.