Upgrade, Backup, and Restore
Before upgrading
- Read the target release notes.
- Stop writes or schedule a maintenance window.
- Stop go-drive so the database and WAL are fully flushed.
- Back up the complete
data-dirand the activeconfig.yml.
Do not copy only data.db. SQLite uses WAL by default and data.db-wal and data.db-shm may exist while the process is running. The safest approach is to stop go-drive and back up the complete data directory.
For MySQL, use the database server's consistency-aware backup tools and separately back up local files, script drives, and other non-database content in data-dir.
Upgrade with Docker
bash
docker pull devld/go-drive
docker stop go-drive
# Example backup; replace the path with your real data directory
cp -a go-drive-data "go-drive-data.backup-$(date +%Y%m%d)"
docker rm go-drive
docker run -d --name go-drive \
-p 8089:8089 \
-v "$(pwd)/go-drive-data:/app/data" \
-v "$(pwd)/config.yml:/app/config.yml:ro" \
--restart unless-stopped \
devld/go-driveWith Compose:
bash
docker compose pull
docker compose up -dAfter upgrading, verify sign-in, drive loading, permissions, search, and jobs. Database migrations run on startup. If an upgrade fails, do not continue writing data and then overwrite the database with an older copy.
Restore
- Stop go-drive.
- Preserve the failed state for diagnosis.
- Restore the configuration and complete data-directory/database backup that belong together.
- Start the go-drive version that matches the backup.
- Verify the instance before allowing writes.
Migrate to another server
- Preserve the
data-dirstructure and file permissions. - If
free-fsis enabled or host absolute paths are mounted, migrate those external directories too. - Update reverse proxy, DNS, OAuth callback, and S3 CORS/hotlink-protection domains.
- MySQL deployments should migrate the database and then the non-database files in
data-dir. - Recheck WebDAV clients and external dependencies used by script drives after migration.