diff --git a/docker-compose.yml b/docker-compose.yml index b9468c0..e73b9bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -47,6 +47,7 @@ services: restart: unless-stopped environment: MEILI_MASTER_KEY: ${MEILI_MASTER_KEY:-aSampleMasterKey} + MEILI_SCHEDULE_SNAPSHOT: ${MEILI_SCHEDULE_SNAPSHOT:-86400} volumes: - meilidata:/meili_data networks: diff --git a/docs/user-guides/upgrade-and-migration/meilisearch-upgrade.md b/docs/user-guides/upgrade-and-migration/meilisearch-upgrade.md index eb4d0ee..e0213b3 100644 --- a/docs/user-guides/upgrade-and-migration/meilisearch-upgrade.md +++ b/docs/user-guides/upgrade-and-migration/meilisearch-upgrade.md @@ -4,9 +4,57 @@ Meilisearch, the search engine used by Open Archiver, requires a manual data mig If an Open Archiver upgrade includes a major Meilisearch version change, you will need to migrate your search index by following the process below. -## Migration Process Overview +## Experimental: Dumpless Upgrade -For self-hosted instances using Docker Compose (as recommended), the migration process involves creating a data dump from your current Meilisearch instance, upgrading the Docker image, and then importing that dump into the new version. +> **Warning:** This feature is currently **experimental**. We do not recommend using it for production environments until it is marked as stable. Please use the [standard migration process](#standard-migration-process-recommended) instead. Proceed with caution. + +Meilisearch recently introduced an experimental "dumpless" upgrade method. This allows you to migrate the database to a new Meilisearch version without manually creating and importing a dump. However, please note that **dumpless upgrades are not currently atomic**. If the process fails, your database may become corrupted, resulting in data loss. + +**Prerequisite: Create a Snapshot** + +Before attempting a dumpless upgrade, you **must** take a snapshot of your instance. This ensures you have a recovery point if the upgrade fails. Learn how to create snapshots in the [official Meilisearch documentation](https://www.meilisearch.com/docs/learn/data_backup/snapshots). + +### How to Enable + +To perform a dumpless upgrade, you need to configure your Meilisearch instance with the experimental flag. You can do this in one of two ways: + +**Option 1: Using an Environment Variable** + +Add the `MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE` environment variable to your `docker-compose.yml` file for the Meilisearch service. + +```yaml +services: + meilisearch: + image: getmeili/meilisearch:v1.x # The new version you want to upgrade to + environment: + - MEILI_MASTER_KEY=${MEILI_MASTER_KEY} + - MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE=true +``` + +**Option 2: Using a CLI Option** + +Alternatively, you can pass the `--experimental-dumpless-upgrade` flag in the command section of your `docker-compose.yml`. + +```yaml +services: + meilisearch: + image: getmeili/meilisearch:v1.x # The new version you want to upgrade to + command: meilisearch --experimental-dumpless-upgrade +``` + +After updating your configuration, restart your container: + +```bash +docker compose up -d +``` + +Meilisearch will attempt to migrate your database to the new version automatically. + +--- + +## Standard Migration Process (Recommended) + +For self-hosted instances using Docker Compose, the recommended migration process involves creating a data dump from your current Meilisearch instance, upgrading the Docker image, and then importing that dump into the new version. ### Step 1: Create a Dump