Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: remove backup download functionality

dragarcia2608043ad27f
diff --git a/apps/docs/pages/guides/platform/backups.mdx b/apps/docs/pages/guides/platform/backups.mdx
index 65f60334402..74cdbe0ba86 100644
--- a/apps/docs/pages/guides/platform/backups.mdx
+++ b/apps/docs/pages/guides/platform/backups.mdx
@@ -43,7 +43,7 @@ The PostgreSQL utility [pg_dumpall](https://www.postgresql.org/docs/current/app-
![Scheduled backups dashboard](/docs/img/backups-daily-dashboard.png)
-You can access daily backups in the [Scheduled backups](https://supabase.com/dashboard/project/_/database/backups/scheduled) settings in the Dashboard. Pro plan projects can access the last 7 days' worth of daily backups while Enterprise plan projects can access up to 30 days' worth of daily backups. Users can restore their project to any one of the backups or download them as a zipped SQL file.
+You can access daily backups in the [Scheduled backups](https://supabase.com/dashboard/project/_/database/backups/scheduled) settings in the Dashboard. Pro plan projects can access the last 7 days' worth of daily backups while Enterprise plan projects can access up to 30 days' worth of daily backups. Users can restore their project to any one of the backups. If you wish to generate a logical backup on your own, you can do so through the [Supabase CLI](/docs/reference/cli/supabase-db-dump).
### Restoration Process [#daily-backups-restoration-process]
diff --git a/studio/components/interfaces/Database/Backups/BackupItem.tsx b/studio/components/interfaces/Database/Backups/BackupItem.tsx
index be03cf13da2..2565cb791fa 100644
--- a/studio/components/interfaces/Database/Backups/BackupItem.tsx
+++ b/studio/components/interfaces/Database/Backups/BackupItem.tsx
@@ -2,10 +2,9 @@ import { PermissionAction } from '@supabase/shared-types/out/constants'
import { useQueryClient } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { useRouter } from 'next/router'
-import { Badge, Button, IconDownload } from 'ui'
+import { Badge, Button } from 'ui'
import { confirmAlert } from 'components/to-be-cleaned/ModalsDeprecated/ConfirmModal'
-import { useBackupDownloadMutation } from 'data/database/backup-download-mutation'
import { useBackupRestoreMutation } from 'data/database/backup-restore-mutation'
import { setProjectStatus } from 'data/projects/projects-query'
import { useCheckPermissions, useStore } from 'hooks'
@@ -42,19 +41,6 @@ const BackupItem = ({ projectRef, backup, index }: BackupItemProps) => {
},
})
- const { mutate: downloadBackup, isLoading: isDownloading } = useBackupDownloadMutation({
- onSuccess: (res) => {
- const { fileUrl } = res
-
- // Trigger browser download by create,trigger and remove tempLink
- const tempLink = document.createElement('a')
- tempLink.href = fileUrl
- document.body.appendChild(tempLink)
- tempLink.click()
- document.body.removeChild(tempLink)
- },
- })
-
const onRestoreClick = () => {
confirmAlert({
title: 'Confirm to restore',
@@ -72,22 +58,12 @@ const BackupItem = ({ projectRef, backup, index }: BackupItemProps) => {
{backup.data.canRestore && (
<Button
type="default"
- disabled={!canTriggerScheduledBackups || isRestoring || isDownloading}
+ disabled={!canTriggerScheduledBackups || isRestoring}
onClick={onRestoreClick}
>
Restore
</Button>
)}
-
- <Button
- type="default"
- disabled={!canTriggerScheduledBackups || isRestoring || isDownloading}
- onClick={() => downloadBackup({ ref: projectRef, backup })}
- loading={isDownloading}
- icon={<IconDownload />}
- >
- Download
- </Button>
</div>
)
return <Badge color="yellow">Backup In Progress...</Badge>
diff --git a/studio/data/database/backup-download-mutation.ts b/studio/data/database/backup-download-mutation.ts
deleted file mode 100644
index 565fbb72de2..00000000000
--- a/studio/data/database/backup-download-mutation.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
-import { toast } from 'react-hot-toast'
-
-import { post } from 'data/fetchers'
-import { ResponseError } from 'types'
-import { Backup } from './backup-restore-mutation'
-
-export type BackupDownloadVariables = {
- ref: string
- backup: Backup
-}
-
-export async function downloadBackup({ ref, backup }: BackupDownloadVariables) {
- const { data, error } = await post('/platform/database/{ref}/backups/download', {
- params: { path: { ref } },
- body: { ...backup, status: backup.status as unknown as string },
- })
- if (error) throw error
- return data
-}
-
-type BackupDownloadData = Awaited<ReturnType<typeof downloadBackup>>
-
-export const useBackupDownloadMutation = ({
- onSuccess,
- onError,
- ...options
-}: Omit<
- UseMutationOptions<BackupDownloadData, ResponseError, BackupDownloadVariables>,
- 'mutationFn'
-> = {}) => {
- return useMutation<BackupDownloadData, ResponseError, BackupDownloadVariables>(
- (vars) => downloadBackup(vars),
- {
- async onSuccess(data, variables, context) {
- await onSuccess?.(data, variables, context)
- },
- async onError(data, variables, context) {
- if (onError === undefined) {
- toast.error(`Failed to download backup: ${data.message}`)
- } else {
- onError(data, variables, context)
- }
- },
- ...options,
- }
- )
-}