[PR #14135] [MERGED] Add declarative backups for migrations #13847

Closed
opened 2026-02-07 07:20:08 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/14135
Author: @JPVenson
Created: 5/19/2025
Status: Merged
Merged: 6/4/2025
Merged by: @crobibero

Base: masterHead: bugfix/ReintroduceSystemBackupOnMigration


📝 Commits (10+)

📊 Changes

15 files changed (+370 additions, -109 deletions)

View changed files

📝 Jellyfin.Server.Implementations/FullSystemBackup/BackupOptions.cs (+2 -0)
📝 Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs (+81 -71)
📝 Jellyfin.Server/Migrations/JellyfinMigrationAttribute.cs (+2 -2)
Jellyfin.Server/Migrations/JellyfinMigrationBackupAttribute.cs (+35 -0)
📝 Jellyfin.Server/Migrations/JellyfinMigrationService.cs (+209 -5)
📝 Jellyfin.Server/Migrations/Routines/FixAudioData.cs (+1 -24)
📝 Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs (+1 -0)
📝 Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs (+1 -0)
📝 Jellyfin.Server/Migrations/Stages/CodeMigration.cs (+3 -1)
📝 Jellyfin.Server/Migrations/Stages/JellyfinMigrationStageTypes.cs (+1 -1)
📝 Jellyfin.Server/Program.cs (+6 -4)
📝 MediaBrowser.Controller/SystemBackupService/BackupOptionsDto.cs (+5 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs (+7 -0)
📝 src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs (+15 -0)
📝 tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs (+1 -1)

📄 Description

Reintroduces backups managed by the migration service

Summary by CodeRabbit

  • New Features

    • Added options to include or exclude the database when creating or restoring backups.
    • Introduced automated backup and rollback support during system migrations, improving reliability and safety.
    • Enhanced migration routines with attributes to specify required backup types for each migration step.
  • Bug Fixes

    • Removed redundant manual backup logic from specific migration routines in favor of centralized backup management.
  • Chores

    • Improved backup cleanup after migration, ensuring temporary backup files are properly deleted.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/14135 **Author:** [@JPVenson](https://github.com/JPVenson) **Created:** 5/19/2025 **Status:** ✅ Merged **Merged:** 6/4/2025 **Merged by:** [@crobibero](https://github.com/crobibero) **Base:** `master` ← **Head:** `bugfix/ReintroduceSystemBackupOnMigration` --- ### 📝 Commits (10+) - [`b0b3194`](https://github.com/jellyfin/jellyfin/commit/b0b31949a6895fdcc5330f4c51bb916ac213016a) Add declarative backups for migrations - [`e20cee6`](https://github.com/jellyfin/jellyfin/commit/e20cee69c0832a25662789ca9adfd59cbd3709a6) Add migration backups - [`b37485a`](https://github.com/jellyfin/jellyfin/commit/b37485ae171f38115958582c1654557b1c70899e) Fix tests - [`361737d`](https://github.com/jellyfin/jellyfin/commit/361737dc558e764f7a36989daa0acf94efccd13e) Fix comment - [`346dcb2`](https://github.com/jellyfin/jellyfin/commit/346dcb238ea57206e5f8241e3f43b907f61d4cfd) Reintroduce FastBackup method for saving jellyfin.db - [`86e70d1`](https://github.com/jellyfin/jellyfin/commit/86e70d1ad3241d6a99627a291e9e05ed32b7bb1e) clarify Log error - [`f9690c4`](https://github.com/jellyfin/jellyfin/commit/f9690c450318f5879a892905d70b483f33bf7f3f) clarify log entry - [`dcdc0c6`](https://github.com/jellyfin/jellyfin/commit/dcdc0c665393a799e381e1a1aef75e105f0dcafc) fix log entry - [`7e38bc6`](https://github.com/jellyfin/jellyfin/commit/7e38bc64a904d993cf3bd29459f65a1101fa6102) Handle mutliple Backup attributes - [`10c26e6`](https://github.com/jellyfin/jellyfin/commit/10c26e68966f2b51e5c97bd49ceb4feb326624e8) Rename enum member ### 📊 Changes **15 files changed** (+370 additions, -109 deletions) <details> <summary>View changed files</summary> 📝 `Jellyfin.Server.Implementations/FullSystemBackup/BackupOptions.cs` (+2 -0) 📝 `Jellyfin.Server.Implementations/FullSystemBackup/BackupService.cs` (+81 -71) 📝 `Jellyfin.Server/Migrations/JellyfinMigrationAttribute.cs` (+2 -2) ➕ `Jellyfin.Server/Migrations/JellyfinMigrationBackupAttribute.cs` (+35 -0) 📝 `Jellyfin.Server/Migrations/JellyfinMigrationService.cs` (+209 -5) 📝 `Jellyfin.Server/Migrations/Routines/FixAudioData.cs` (+1 -24) 📝 `Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs` (+1 -0) 📝 `Jellyfin.Server/Migrations/Routines/MigrateRatingLevels.cs` (+1 -0) 📝 `Jellyfin.Server/Migrations/Stages/CodeMigration.cs` (+3 -1) 📝 `Jellyfin.Server/Migrations/Stages/JellyfinMigrationStageTypes.cs` (+1 -1) 📝 `Jellyfin.Server/Program.cs` (+6 -4) 📝 `MediaBrowser.Controller/SystemBackupService/BackupOptionsDto.cs` (+5 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Implementations/IJellyfinDatabaseProvider.cs` (+7 -0) 📝 `src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs` (+15 -0) 📝 `tests/Jellyfin.Server.Integration.Tests/JellyfinApplicationFactory.cs` (+1 -1) </details> ### 📄 Description Reintroduces backups managed by the migration service <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added options to include or exclude the database when creating or restoring backups. - Introduced automated backup and rollback support during system migrations, improving reliability and safety. - Enhanced migration routines with attributes to specify required backup types for each migration step. - **Bug Fixes** - Removed redundant manual backup logic from specific migration routines in favor of centralized backup management. - **Chores** - Improved backup cleanup after migration, ensuring temporary backup files are properly deleted. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 07:20:08 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#13847