#293: Folks, I've upgraded the ORM and db connector from Prisma 4 to 7. This should hopefully give us some speed bonuses with TS/Rust driving the query engine and Better SQLite driving the queries. It's working on dev and my docker set up - and no migrations are involved... So it should just work. Don't be a d**k like me and take a backup just in case, will yas?
#294 I've thrown in some db backup scripts as well. It'll back up 1. When a migration is going to happen 2. Using a cron. There are sensible defaults with overrides in the .env.template file. I might throw in some cron/backup viewer into the admin settings area if I'm feeling saucy.
Here's some machine gen info about the backup... Yep I (supervised) used an agent to build this upgrade, because life is juuuust to short to spend a day or two on something like a node package upgrade.
Upgrading to Prisma 7
What's New
- Performance improvements: Faster queries with rebuilt TypeScript engine
- Better SQLite performance: Using optimized
better-sqlite3driver - Security patches: 2+ years of updates from Prisma 4.x to 7.x
- Automated backups: Scheduled weekly backups + automatic pre-migration backups
Upgrade Instructions (Docker)
The upgrade is seamless - your database and configuration remain unchanged.
1. Backup Your Database (Recommended)
# Stop your container
docker-compose down
# Backup your database
cp ./db/dev.sqlite ./db/dev.sqlite.backup-$(date +%Y%m%d)Note: The container now includes automatic backups before schema migrations and weekly scheduled backups. This manual backup is just extra insurance for the upgrade itself.
2. Pull and Restart
# Pull the latest image
docker pull jt196/vanilla-cookbook:latest
# Start the container
docker-compose up -d3. Verify
# Check logs for successful startup
docker logs vanilla-cookbook
# Should see "No pending migrations to apply" and "ready in XXXms"That's it! Your recipes, users, and data remain untouched.
What If Something Goes Wrong?
Quick Rollback
# Stop current container
docker-compose down
# Restore your database backup
cp ./db/dev.sqlite.backup-YYYYMMDD ./db/dev.sqlite
# Use previous stable version
docker pull jt196/vanilla-cookbook:stable
# Update docker-compose.yml to use :stable instead of :latest
# Then restart
docker-compose up -dWhat Didn't Change
- ✅ Your
.envfile - no changes needed - ✅ Your
docker-compose.ymlfile - no changes needed - ✅ Your database schema - fully compatible
- ✅ Your recipes, users, uploads - everything preserved
- ✅ Volume mounts -
./dband./uploadsremain the same
New Backup Features
Automatic Backups
The container now includes two types of automatic backups:
- Pre-migration backups: Created automatically before any schema migrations (
auto-backup-YYYYMMDD-HHMMSS.sqlite) - Scheduled backups: Weekly by default, every Sunday at 3am (
scheduled-backup-YYYYMMDD-HHMMSS.sqlite)
All backups are stored in your mounted ./db folder.
Configuring Backups (Optional)
Edit your .env file to customize backup behavior:
# Change schedule (default: Sundays at 3am)
BACKUP_CRON_SCHEDULE=0 2 * * * # Daily at 2am
# Change retention (default: 6 backups)
BACKUP_RETENTION_COUNT=12 # Keep 12 backupsAfter changing, restart the container: docker-compose restart
Common schedules:
0 2 * * *- Daily at 2am0 4 * * 1- Mondays at 4am0 3 1 * *- 1st of month at 3am0 */6 * * *- Every 6 hours
Getting Help
If you encounter issues:
- Check GitHub Issues
- Create a new issue with:
- Output of
docker logs vanilla-cookbook - Your docker-compose.yml (redact sensitive info)
- Whether rollback to
:stableworked
- Output of