feat: restore mysql from generic destinations

This commit is contained in:
Furox 2026-09-04 20:26:54 +03:00 committed by Furox88
parent 8def29a688
commit cba8f608db

View File

@ -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({