diff --git a/packages/server/src/utils/restore/mysql.ts b/packages/server/src/utils/restore/mysql.ts index d237da895..bd6f55292 100644 --- a/packages/server/src/utils/restore/mysql.ts +++ b/packages/server/src/utils/restore/mysql.ts @@ -3,7 +3,7 @@ import type { Destination } from "@dokploy/server/services/destination"; import type { MySql } from "@dokploy/server/services/mysql"; import { quote } from "shell-quote"; import type { z } from "zod"; -import { getS3Credentials } from "../backups/utils"; +import { getRclonePathAndFlags } from "../backups/utils"; import { execAsync, execAsyncRemote } from "../process/execAsync"; import { getRestoreCommand } from "./utils"; @@ -16,10 +16,8 @@ export const restoreMySqlBackup = async ( try { const { appName, databaseRootPassword, serverId } = mysql; - const rcloneFlags = getS3Credentials(destination); - const bucketPath = `:s3:${destination.bucket}`; - const backupPath = `${bucketPath}/${backupInput.backupFile}`; - + const { flags: rcloneFlags, path: backupPath } = + await getRclonePathAndFlags(destination, backupInput.backupFile); const rcloneCommand = `rclone cat ${rcloneFlags.join(" ")} ${quote([backupPath])} | gunzip`; const command = getRestoreCommand({