You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: qdrant-backup-restore/README.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,19 @@ Create a `.env` file based on `.env.sample` with the following variables:
63
63
|`QDRANT_RESTORE_HOSTS`| Comma-separated list of destination Qdrant hosts set as `""`|`""`|
64
64
|`GET_PEERS_FROM_CLUSTER_INFO`| Auto-discover peers from Qdrant cluster info endpoint (only for Kubernetes) |`false`|
65
65
66
+
if `BACKUP_COLLECTION_ALIASES_ON_S3` is `true` include the S3 credentials. When `true` ensure S3 credentials are set i.e. `QDRANT_S3_SECRET_ACCESS_KEY`, `QDRANT_S3_SECRET_ACCESS_KEY`, `QDRANT_S3_ENDPOINT_URL`, `QDRANT_S3_BUCKET_NAME` (use same bucket name on qdrant configuration).
67
+
68
+
#### Required Variables For Optional Collection Aliases Backup
69
+
| Variable | Description | Default |
70
+
|----------|-------------|---------|
71
+
|`QDRANT_SOURCE_HOSTS`| Comma-separated list of source Qdrant hosts |`http://localhost:6333`|
72
+
|`QDRANT_RESTORE_HOSTS`| Comma-separated list of destination Qdrant hosts set as `""`|`""`|
|`QDRANT_S3_BUCKET_NAME`| S3 bucket name where snapshots are stored |`bucket-name`|
77
+
|`BACKUP_COLLECTION_ALIASES_ON_S3`| set `true` to toggle backing up collection aliases on S3 |`false`|
78
+
66
79
#### Required Variables For Restore
67
80
68
81
| Variable | Description | Default |
@@ -308,10 +321,10 @@ source .env.dest
308
321
- `QDRANT_API_KEY` - set your Qdrant api key if it exists otherwise leave as is.
309
322
- `QDRANT_SOURCE_HOSTS` - set your Qdrant source host. if you are connecting to your a qdrant cluster deployed on kubernetes use port forwarding. Ensure **all** the pods/containers can be reached locally. Add these comma seperated hosts in this config .e.g `"http://qdrant-source-1:6333,http://qdrant-source-1:6334"`. This is required only for the backup process. In Kubernetes, service/peer discovery is done automatically by enabling `GET_PEERS_FROM_CLUSTER_INFO`.
310
323
- `QDRANT_RESTORE_HOSTS` - set your Qdrant target restore host **(for restore only)**set as `""` when backing up.
311
-
- `QDRANT_S3_ENDPOINT_URL` - set it to your s3 endpoint url**(for restore only)**.
312
-
- `QDRANT_S3_ACCESS_KEY_ID` - set it to your s3 access key id credentials**(for restore only)**.
313
-
- `QDRANT_S3_SECRET_ACCESS_KEY`- set it to your s3 secret access key credentials**(for restore only)**.
314
-
- `QDRANT_S3_BUCKET_NAME`- set it to your s3 bucket name**(for restore only)**.
324
+
- `QDRANT_S3_ENDPOINT_URL` - set it to your s3 endpoint url.
325
+
- `QDRANT_S3_ACCESS_KEY_ID` - set it to your s3 access key id credentials.
326
+
- `QDRANT_S3_SECRET_ACCESS_KEY`- set it to your s3 secret access key credentials.
327
+
- `QDRANT_S3_BUCKET_NAME`- set it to your s3 bucket name.
315
328
- `GET_PEERS_FROM_CLUSTER_INFO`- leave as is (`false`) for non-cluster usecases.
316
329
- Run below to make the environment variables available.
Copy file name to clipboardExpand all lines: qdrant-backup-restore/k8s/README.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,29 @@ Update the following environment varibles in your copy of `backup-cronjob.yaml`
120
120
5. `CURL_TIMEOUT` is set at `3000` seconds. This is the max time curl will waitforrequest to complete. Its increasedin scenarios where backup takes a while.
121
121
6. `QDRANT_S3_LINK_EXPIRY_DURATION` is set at `3600`. This is the duration that an s3 presigned url will be active. The url is used during the recovery process.
122
122
7. `QDRANT_WAIT_ON_TASK` is set as `true`. This configuation make backup process synchronous meaning 'wait for snapshot process to finish successfully before moving on'. Its used during backup and recovery.
123
+
8. `BACKUP_COLLECTION_ALIASES_ON_S3` is set as `false`. This configuration is used to toggle backup of collection aliases to S3. The collection_aliases are versioned by the timestamp. When `true` ensure S3 credentials are set;
@@ -148,6 +171,8 @@ Update the following environment varibles accordingly;
148
171
7. `QDRANT_WAIT_ON_TASK` is set as `true`. This configuation make restoration process synchronous meaning 'wait for snapshot process to finish successfully before moving on'. Its used during backup and recovery.
149
172
8. `QDRANT_SNAPSHOT_DATETIME_FILTER` is empty. Setting this filters out snapshot/backups belonging to a certain date and time using glob pattern matching. e.g `"2026-01-29"` = all snapshots in 29th January 2026, `2026-01` = all backups in January 2026.
150
173
9. `MC_CONFIG_DIR` is `mc`. This overrides the default storage location ($HOME) formc s3 client configurations. Essentialinset ups that use stricter securityContext configuration like `readOnlyRootFilesystem: true`.
174
+
10. `BACKUP_COLLECTION_ALIASES_ON_S3` is `false`. When this is set to `true` during restoration it will fetch the lastest `collection_alias` from S3.
175
+
11. `QDRANT_COLLECTION_ALIASES_STABLE_FILE` is `collection_aliases`. This configuration is used to override the stable version of collection_aliases file to restore. e.g. `collection_aliases-2026-04-30_18-31-04`. The file has to exist on s3.
_printf "[%s] failed to fetch collection alias %s:%s, got this instead %s\n""$host""$collection_name""$alias_name""${result//[[:space:]]/}"
575
+
_printf "[%s] failed to restore collection alias %s:%s, got this instead %s\n""$host""$collection_name""$alias_name""${result//[[:space:]]/}"
544
576
return
545
577
fi
546
578
@@ -550,6 +582,22 @@ recover_collection_alias() {
550
582
551
583
# restores collection aliases to a qdrant node and appends progress to $QDRANT_ALIAS_RECOVERY_HISTORY_FILE
552
584
recover_collection_aliases() {
585
+
586
+
local host="${restore_hosts[0]}"
587
+
588
+
589
+
if [ "$BACKUP_COLLECTION_ALIASES_ON_S3"="true" ];then
590
+
591
+
setup_s3_storage
592
+
593
+
if mc cp "$QDRANT_S3_ALIAS/$QDRANT_S3_BUCKET_NAME/$QDRANT_COLLECTION_ALIASES_BACKUP_FOLDER/$QDRANT_COLLECTION_ALIASES_STABLE_FILE""$QDRANT_COLLECTION_ALIASES";then
594
+
_printf "collection aliases restored from s3 bucket %s\n""$QDRANT_S3_BUCKET_NAME"
595
+
else
596
+
_printf "failed to restore collection aliases file (%s) from s3 bucket %s\n""$QDRANT_COLLECTION_ALIASES_STABLE_FILE""$QDRANT_S3_BUCKET_NAME"
QDRANT_S3_BUCKET_NAME - S3 bucket name (for S3 operations)
688
736
GET_PEERS_FROM_CLUSTER_INFO - Set to "true" to auto-discover peers
689
-
CURL_TIMEOUT - Curl timeout in seconds (default: 300)
737
+
CURL_TIMEOUT - Curl timeout in seconds (default: 1800)
690
738
QDRANT_WAIT_ON_TASK - Waits for async tasks to finish
691
-
QDRANT_SNAPSHOT_DATETIME_FILTER - Specify the datea and time filter for snapshots to be fetched and/or restored, format YYYY-mm-dd, e,g "2026-01-29-11-44", default value is empty so it will fetch every snapshot!!
739
+
QDRANT_SNAPSHOT_DATETIME_FILTER - Specify the date and time filter for snapshots to be fetched and/or restored, format YYYY-mm-dd, e,g "2026-01-29-11-44", default value is empty so it will fetch every snapshot!!
692
740
Examples:
693
741
$0 get_snap
694
742
$0 recover_snap
@@ -738,11 +786,20 @@ run() {
738
786
local DATETIME="${QDRANT_SNAPSHOT_DATETIME_FILTER:-}"
0 commit comments