mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
feat: add database migration script and update installation instructions for legacy all-in-one users
This commit is contained in:
parent
91c30db3e4
commit
f051c19aca
5 changed files with 684 additions and 1 deletions
|
|
@ -21,6 +21,20 @@ error() { printf "${RED}[SurfSense]${NC} %s\n" "$1" >&2; exit 1; }
|
|||
|
||||
command -v docker >/dev/null 2>&1 || error "Docker is not installed. Please install Docker first: https://docs.docker.com/get-docker/"
|
||||
|
||||
# Detect legacy all-in-one volume — must migrate before installing
|
||||
if docker volume ls --format '{{.Name}}' 2>/dev/null | grep -q '^surfsense-data$'; then
|
||||
printf "${RED}[SurfSense]${NC} Legacy volume 'surfsense-data' detected.\n" >&2
|
||||
printf "${YELLOW}[SurfSense]${NC} You appear to be upgrading from the old all-in-one SurfSense container.\n" >&2
|
||||
printf "${YELLOW}[SurfSense]${NC} The database has been upgraded from PostgreSQL 14 to 17 and your data\n" >&2
|
||||
printf "${YELLOW}[SurfSense]${NC} must be migrated before running the new stack.\n" >&2
|
||||
printf "\n" >&2
|
||||
printf "${YELLOW}[SurfSense]${NC} Run the migration script first:\n" >&2
|
||||
printf "${CYAN}[SurfSense]${NC} curl -fsSL https://raw.githubusercontent.com/MODSetter/SurfSense/main/docker/scripts/migrate-database.sh | bash\n" >&2
|
||||
printf "\n" >&2
|
||||
printf "${YELLOW}[SurfSense]${NC} See the full guide at: https://surfsense.net/docs/how-to/migrate-from-allinone\n" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if docker compose version >/dev/null 2>&1; then
|
||||
DC="docker compose"
|
||||
elif command -v docker-compose >/dev/null 2>&1; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue