-
-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathcompose.migrate-minio.yaml
More file actions
81 lines (77 loc) · 2.91 KB
/
Copy pathcompose.migrate-minio.yaml
File metadata and controls
81 lines (77 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# One-time migration overlay for installations that used Hollo's former MinIO
# Compose setup. New installations and normal operation do not need this file.
#
# Run it from the directory and with the Compose project name used by the old
# installation:
#
# docker compose -f compose.yaml -f compose.migrate-minio.yaml \
# --profile migrate-minio run --rm migrate-minio
# docker compose -f compose.yaml -f compose.migrate-minio.yaml \
# --profile migrate-minio run --rm verify-minio-migration
#
# After verification, stop the temporary services without deleting volumes:
#
# docker compose -f compose.yaml -f compose.migrate-minio.yaml \
# --profile migrate-minio down
#
# Never add `-v` to the `down` command. It would delete the old MinIO media
# volume and the new RustFS volume. See the Docker installation guide for the
# complete procedure: https://docs.hollo.social/install/docker/#migrating-from-minio
services:
# Mount the existing MinIO volume through the exact server version used by
# the former Compose setup.
legacy-minio:
profiles:
- migrate-minio
image: minio/minio:RELEASE.2024-09-13T20-26-02Z
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
command: ["server", "/data"]
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:9000/minio/health/live"]
interval: 2s
timeout: 2s
retries: 30
# Copy the hollo bucket through the S3 API. The old volume itself is not
# compatible with RustFS's on-disk format.
migrate-minio:
profiles:
- migrate-minio
image: docker.io/rclone/rclone:1.73.3
depends_on:
legacy-minio:
condition: service_healthy
rustfs:
condition: service_healthy
environment: &rclone-environment
RCLONE_CONFIG_MINIO_TYPE: s3
RCLONE_CONFIG_MINIO_PROVIDER: Minio
RCLONE_CONFIG_MINIO_ACCESS_KEY_ID: minioadmin
RCLONE_CONFIG_MINIO_SECRET_ACCESS_KEY: minioadmin
RCLONE_CONFIG_MINIO_ENDPOINT: http://legacy-minio:9000
RCLONE_CONFIG_RUSTFS_TYPE: s3
RCLONE_CONFIG_RUSTFS_PROVIDER: Minio
RCLONE_CONFIG_RUSTFS_ACCESS_KEY_ID: rustfsadmin
RCLONE_CONFIG_RUSTFS_SECRET_ACCESS_KEY: rustfsadmin
RCLONE_CONFIG_RUSTFS_ENDPOINT: http://rustfs:9000
command: ["copy", "minio:hollo", "rustfs:hollo", "--metadata", "--progress"]
# Compare object contents and metadata before the old volume is retired.
verify-minio-migration:
profiles:
- migrate-minio
image: docker.io/rclone/rclone:1.73.3
depends_on:
legacy-minio:
condition: service_healthy
rustfs:
condition: service_healthy
environment: *rclone-environment
command:
["check", "minio:hollo", "rustfs:hollo", "--metadata", "--combined", "-"]
volumes:
# Compose resolves this to the existing project-scoped minio_data volume
# when the same directory and project name are used.
minio_data: