docs: upstream migration guide + one-command migrate.sh

The fork's own compose file still pointed at upstream's image.
Repointed it to ghcr.io/dvorinka/cloudreve and documented the
drop-in migration path (compose swap, plain docker, binary) in
the README. migrate.sh rewrites the image line in an existing
upstream compose project, backs it up, and restarts the stack.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
pull/3593/head
Tomas Dvorak 2 weeks ago
parent 01963f06d1
commit 1a6f13fd09

@ -33,6 +33,55 @@
- **Tests and CI are real.** GitHub Actions run backend tests, frontend typecheck/build, and the - **Tests and CI are real.** GitHub Actions run backend tests, frontend typecheck/build, and the
desktop matrix (Windows/macOS/Linux) on every PR. desktop matrix (Windows/macOS/Linux) on every PR.
## Migrating from upstream Cloudreve
This fork is a drop-in replacement: same 4.19.x schema baseline, same `/cloudreve/data` volume
layout, same `CR_CONF_*` env vars, same port 5212. Existing accounts, files, shares, and settings
carry over — schema migrations run automatically on first boot. Back up your data volume and
database first, as with any upgrade.
**Docker Compose** — one command (backs up your compose file, swaps the image, restarts):
```bash
curl -sSL https://raw.githubusercontent.com/Dvorinka/cloudreve/master/migrate.sh | sh -s -- /path/to/compose/dir
```
Or edit `docker-compose.yml` by hand — only the image changes, everything else stays identical to
the [upstream compose setup](https://github.com/cloudreve/docker-compose):
```diff
services:
cloudreve:
- image: cloudreve/cloudreve:v4
+ image: ghcr.io/dvorinka/cloudreve:latest
```
```bash
docker compose pull && docker compose up -d
```
**Plain docker** — same flags, new image:
```bash
docker stop cloudreve && docker rm cloudreve
docker run -d --name cloudreve --restart unless-stopped \
-p 5212:5212 -v backend_data:/cloudreve/data \
ghcr.io/dvorinka/cloudreve:latest
```
**Binary** — stop the service, drop in the binary from
[Releases](https://github.com/Dvorinka/cloudreve/releases), start. Your `data/` directory
(SQLite, uploads, `conf.ini`) is untouched.
Notes:
- Tags: `latest` / `slim` track the newest release; pin `ghcr.io/dvorinka/cloudreve:v4.19.2` for
reproducibility. Slim drops aria2, LibreOffice, ffmpeg, and font/media tooling.
- `CR_LICENSE_KEY` has no effect — Pro-class features are reimplemented as free features; the key
is simply ignored.
- Migration is supported from upstream ≤ 4.19.x. If you run a newer upstream than our latest
release, wait for the next tag rather than downgrading the schema.
## Repository layout ## Repository layout
``` ```

@ -1,6 +1,6 @@
services: services:
cloudreve: cloudreve:
image: cloudreve/cloudreve:latest image: ghcr.io/dvorinka/cloudreve:latest
container_name: cloudreve-backend container_name: cloudreve-backend
depends_on: depends_on:
- postgresql - postgresql

@ -0,0 +1,39 @@
#!/bin/sh
# migrate.sh — switch an existing upstream Cloudreve docker-compose deployment
# to this fork. All data (volumes, database, env config) is preserved; only the
# container image changes. Usage: sh migrate.sh [compose-project-dir]
set -eu
DIR="${1:-.}"
IMAGE="ghcr.io/dvorinka/cloudreve:latest"
for f in docker-compose.yml docker-compose.yaml compose.yml compose.yaml; do
if [ -f "$DIR/$f" ]; then COMPOSE_FILE="$DIR/$f"; break; fi
done
if [ -z "${COMPOSE_FILE:-}" ]; then
echo "No compose file found in $DIR" >&2
exit 1
fi
if ! grep -q "cloudreve/cloudreve" "$COMPOSE_FILE"; then
echo "No upstream 'cloudreve/cloudreve' image found in $COMPOSE_FILE — nothing to migrate." >&2
exit 1
fi
cp "$COMPOSE_FILE" "$COMPOSE_FILE.bak"
sed -i "s|image: *cloudreve/cloudreve:[^ ]*|image: $IMAGE|" "$COMPOSE_FILE"
echo "Updated $COMPOSE_FILE (backup: $COMPOSE_FILE.bak)"
cd "$DIR"
if docker compose version >/dev/null 2>&1; then
docker compose pull && docker compose up -d
elif command -v docker-compose >/dev/null 2>&1; then
docker-compose pull && docker-compose up -d
else
echo "docker compose not found — install it, then run: docker compose pull && docker compose up -d" >&2
exit 1
fi
echo "Migration complete. Cloudreve is on port 5212; existing accounts, files, and settings carry over."
Loading…
Cancel
Save