Skip to content

style: add backup recommendation before rebuilding database#4892

Open
damiogunsiji wants to merge 2 commits into
Dokploy:canaryfrom
damiogunsiji:style/add-backup-warning-to-rebuild-database
Open

style: add backup recommendation before rebuilding database#4892
damiogunsiji wants to merge 2 commits into
Dokploy:canaryfrom
damiogunsiji:style/add-backup-warning-to-rebuild-database

Conversation

@damiogunsiji

@damiogunsiji damiogunsiji commented Jul 22, 2026

Copy link
Copy Markdown

feat: add backup recommendation with one-click navigation before rebuilding database

Problem

When users click "Rebuild Database" in the Danger Zone, the dialog warns about data loss but never suggests creating a backup first — nor provides a way to navigate there directly. This puts user data at unnecessary risk, especially since Dokploy already has a backup system in place.

Solution

Added backup reminder text in two places, both with clickable links that navigate directly to the Backups tab:

  1. Card body — below the destructive warning description:

    ⚠️ Recommended: Create a backup before rebuilding to avoid permanent data loss.

  2. Confirmation dialog — after "This action cannot be undone":

    ⚠️ Tip: Go to the Backups tab to create a backup before rebuilding.

Changes

File Change
apps/dokploy/components/dashboard/shared/rebuild-database.tsx Added two amber-colored alert paragraphs with AlertTriangle icon and onClick handlers that navigate to ?tab=backups via router.push with shallow: true
apps/dokploy/pages/.../services/postgres/[postgresId].tsx Added useEffect to sync tab state from router.query.tab
apps/dokploy/pages/.../services/mongo/[mongoId].tsx Same
apps/dokploy/pages/.../services/mysql/[mysqlId].tsx Same
apps/dokploy/pages/.../services/mariadb/[mariadbId].tsx Same
apps/dokploy/pages/.../services/libsql/[libsqlId].tsx Same
apps/dokploy/pages/.../services/redis/[redisId].tsx Same

How it works

The clickable text uses router.push(url, undefined, { shallow: true }) — matching the project's existing tab-switching convention. A useEffect in each database page syncs the local tab state with the URL's ?tab= parameter, so clicking the link properly switches to the Backups tab without a full page reload.

Screenshots

Screenshot 2026-07-22 at 07 41 24 Screenshot 2026-07-22 at 07 40 24

Testing

  • pnpm typecheck — passes clean for apps/dokploy
  • Verified the clickable text navigates to the Backups tab
  • No logic changes to the rebuild mutation itself — purely UI additions

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 22, 2026
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant