-
-
Notifications
You must be signed in to change notification settings - Fork 301
Thumbnail System Migration
crocodilestick edited this page Sep 25, 2025
·
1 revision
Starting with version 3.2.0, Calibre-Web-Automated uses an improved thumbnail storage system:
- 🎯 Deterministic naming:
book_<id>_r<resolution>.webpinstead of UUID-based names - 🖼️ WebP format: Better compression and quality than JPEG
- 📁 Flat directory: All thumbnails stored in
/config/thumbnails/directly (no subdirectories) - 🔄 Automatic migration: Old thumbnails are cleaned up automatically on startup
- ✅ No migration needed
- 🚀 Thumbnails are generated in the new format from the start
On the first startup after updating, the system will:
- 🔍 Detect old thumbnail structure (hex subdirectories like
00/,01/,bo/, etc.) - 🗃️ Clear old database entries to ensure clean migration
- 🗂️ Remove old files and subdirectories from
/config/thumbnails/ - 📝 Log the migration process for transparency
- ✅ Mark migration as completed to prevent re-running
INFO: Thumbnail migration: Found 158 old subdirectories, starting migration
INFO: Thumbnail migration: Cleared 255 old database entries
INFO: Thumbnail migration: Removed 255 old files and 158 subdirectories
INFO: Thumbnail migration: Complete. Thumbnails will be regenerated automatically as needed.
- 🔄 Thumbnails will be regenerated automatically as books are accessed
- 🖱️ You can manually trigger regeneration via Admin → "Refresh Thumbnail Cache"
- 📂 New structure:
/config/thumbnails/book_123_r2.webp(directly in folder) - 📁 Old structure:
/config/thumbnails/bo/book_123_r2.webp(in subdirectories) ← removed
- 🐛 Easier debugging: Filenames directly show book ID and resolution
- ⚡ Better performance: No filesystem overhead from empty subdirectories
- 🧹 Simpler maintenance: All files in one location
- 🖼️ Improved quality: WebP format provides better compression
- 🔮 Future-proof: Deterministic naming supports advanced features
If you need to rollback before migration completes:
- 🛑 Stop the CWA container
- 💾 Restore
/config/thumbnails/from backup - 🔄 Restart with the previous CWA version
- 📋 Check logs for specific error messages
- 🔐 Ensure
/config/thumbnails/is writable by theabcuser - 🔄 Migration will be retried on next startup if it fails
docker exec -it cwa-dev chown -R abc:abc /config/thumbnails
docker exec -it cwa-dev chmod 755 /config/thumbnailsIf you need to test migration again:
-- Connect to app.db and remove migration marker
DELETE FROM settings WHERE mail_server = 'thumbnail_flat_structure_migration';- ⏱️ Migration time: ~1-5 seconds for typical libraries (100-1000 books)
- 💽 Disk space: Temporarily ~2x during migration, then reduced due to WebP compression
- 🚫 No downtime: Migration runs during normal startup process
- 🛡️ Graceful failure: App continues working even if migration fails