feat: implement backup management features and export functionality#4773
feat: implement backup management features and export functionality#4773biggora wants to merge 5 commits intohomarr-labs:devfrom
Conversation
|
Here's the code health analysis summary for commits Analysis Summary
|
|
Minimum review criteria is not met, please fix the deepsource issues. |
df1c4e8 to
e3225fe
Compare
|
@biggora you don't need to force-push all your commits, you can leave them linear and we'll squash on merge |
just a habit :) |
no worries then. It would be helpful if you could add some screenshots to your PR |
added screenshots |
There was a problem hiding this comment.
Still in the process of reviewing by testing the branch. There are leftover changes from something you didn't entirely finish building. If you could make new commits to delete these artifacts it would be helpful
Also as a sidenote @biggora do you think it would be possible for you to add unit tests of this feature during the init stage ? Simply by adding the json/zip to be used inside of these tests I think we could leverage this feature to set up a demo instance of homarr
apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx
Show resolved
Hide resolved
|
@biggora another comment is that you should use the same component to render users in the manage/users page to get a link to the user + the correct user icon to display
|
|
done |
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive backup and restore system for Homarr, enabling users to export their entire configuration or individual boards and restore them when needed. The implementation includes database schema updates to track backups, a new backup package with export/import functionality, validation mechanisms, and extensive internationalization support across 36 languages.
Key changes:
- New backup database table and migration files for SQLite, PostgreSQL, and MySQL
- Complete backup package with export, import, and validation services
- Translation keys added for 36 language files to support the backup UI
- Full restore capability with merge and full restore modes
Reviewed changes
Copilot reviewed 86 out of 88 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/db/schema/*.ts | Added backup table schema definition and relations across all database types |
| packages/db/migrations/*/0035_add_backups.sql | Migration files creating the backup table in each database dialect |
| packages/translation/src/lang/*.json | Translation keys for backup UI added to all 36 supported languages |
| packages/backup/src/types.ts | TypeScript type definitions for backup operations and data structures |
| packages/backup/src/import/validator.ts | Validation logic for backup files before restoration |
| packages/backup/src/import/importer.ts | Core import logic handling data restoration with dependency ordering |
| packages/backup/src/import/tests/validator.spec.ts | Unit tests for backup validation functionality |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db62484 to
47078d5
Compare
ajnart
left a comment
There was a problem hiding this comment.
It looks good to me, thank you for the contribution.
4a0ef50 to
e37ab84
Compare
bcf4b0b to
15d0c59
Compare
Meierschlumpf
left a comment
There was a problem hiding this comment.
I'm not done with the review yet, but here a first collection of feedback. Additionally I have a few notes:
- The translations should not be part of the pull request and are rather done later by the translators on Crowdin. So please only change the en.json file
- It's great that you were motivated to contribute, however it would have been better if you first discussed possible solutions with the team. E.g. I already had a few ideas on how a backup system could look like and the main problem with most systems is, that they are a lot of effort to maintain (as when the db changes, you have to manually adjust the import system), therefore I'm not sure yet if we should add this or create a better system that can automatically update when new tables are added to the db.
Anyway, I'll discuss with the team how we move forward and if we continue with this implementation I'll review the missing parts
apps/nextjs/src/app/[locale]/init/_steps/start/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/init/_steps/start/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/init/_steps/start/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/boards/_components/board-card-menu-dropdown.tsx
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/tools/backups/_components/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/tools/backups/_components/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/tools/backups/_components/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/tools/backups/_components/restore-backup-button.tsx
Outdated
Show resolved
Hide resolved
apps/nextjs/src/app/[locale]/manage/tools/backups/_components/restore-backup-button.tsx
Show resolved
Hide resolved
1a0fe75 to
4a322d5
Compare
|
@biggora we've decided that this feature might be annoying to maintain moving forward. What happens if I backup a board in a previous version and want to restore it ? In order to mitigate this issue I see 2 possible solutions :
What do you think about these changes ? I personally don't mind adding a "pain" to the user that they have to temporarily rollback to a previous version to restore the backup. |
@ajnart |
|
|
d9b662a to
9f784b4
Compare
b243737 to
274712f
Compare


A comprehensive backup system has been implemented, allowing you to export the entire configuration or individual boards and restore them if necessary.
pnpm build, autofix withpnpm format:fix)devbranchx,y,ior any abbrevation)Link to the merge request documentation homarr-labs/documentation#477