mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-09-14 11:06:15 +05:00
refactor: improve restore logging for database backups (#4566)
Some checks are pending
Auto PR to main when version changes / create-pr (push) Waiting to run
Build Docker images / build-and-push-cloud-image (push) Waiting to run
Build Docker images / build-and-push-schedule-image (push) Waiting to run
Build Docker images / build-and-push-server-image (push) Waiting to run
Dokploy Docker Build / docker-amd (push) Waiting to run
Dokploy Docker Build / docker-arm (push) Waiting to run
Dokploy Docker Build / combine-manifests (push) Blocked by required conditions
Dokploy Docker Build / generate-release (push) Blocked by required conditions
Dokploy Docker Build / sync-version (push) Blocked by required conditions
autofix.ci / format (push) Waiting to run
Dokploy Monitoring Build / docker-amd (push) Waiting to run
Dokploy Monitoring Build / docker-arm (push) Waiting to run
Dokploy Monitoring Build / combine-manifests (push) Blocked by required conditions
Generate and Sync OpenAPI / Generate OpenAPI and commit to Dokploy repo (push) Waiting to run
Some checks are pending
Auto PR to main when version changes / create-pr (push) Waiting to run
Build Docker images / build-and-push-cloud-image (push) Waiting to run
Build Docker images / build-and-push-schedule-image (push) Waiting to run
Build Docker images / build-and-push-server-image (push) Waiting to run
Dokploy Docker Build / docker-amd (push) Waiting to run
Dokploy Docker Build / docker-arm (push) Waiting to run
Dokploy Docker Build / combine-manifests (push) Blocked by required conditions
Dokploy Docker Build / generate-release (push) Blocked by required conditions
Dokploy Docker Build / sync-version (push) Blocked by required conditions
autofix.ci / format (push) Waiting to run
Dokploy Monitoring Build / docker-amd (push) Waiting to run
Dokploy Monitoring Build / docker-arm (push) Waiting to run
Dokploy Monitoring Build / combine-manifests (push) Blocked by required conditions
Generate and Sync OpenAPI / Generate OpenAPI and commit to Dokploy repo (push) Waiting to run
* refactor: improve restore logging for database backups - Updated restore functions across various database types (Postgres, MySQL, MongoDB, MariaDB, LibSQL, and Compose) to provide clearer logging messages. - Replaced generic command execution logs with specific messages indicating the database being restored and the source backup file. - This change enhances the clarity of restore operations and aids in troubleshooting by providing more context in the logs. * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
c968a2755e
commit
0f76d8f385
@ -77,9 +77,9 @@ export const restoreComposeBackup = async (
|
||||
});
|
||||
|
||||
emit("Starting restore...");
|
||||
emit(`Backup path: ${backupPath}`);
|
||||
|
||||
emit(`Executing command: ${restoreCommand}`);
|
||||
emit(
|
||||
`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
|
||||
);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, restoreCommand);
|
||||
|
||||
@ -21,15 +21,13 @@ export const restoreLibsqlBackup = async (
|
||||
|
||||
const rcloneCommand = `rclone cat ${rcloneFlags.join(" ")} "${backupPath}"`;
|
||||
|
||||
emit("Starting restore...");
|
||||
emit(`Backup path: ${backupPath}`);
|
||||
|
||||
const containerSearch = getServiceContainerCommand(appName);
|
||||
const restoreCommand = `docker exec -i $CONTAINER_ID sh -c "tar xzf - -C /var/lib/sqld"`;
|
||||
|
||||
const command = `CONTAINER_ID=$(${containerSearch}) && ${rcloneCommand} | ${restoreCommand}`;
|
||||
|
||||
emit(`Executing command: ${command}`);
|
||||
emit("Starting restore...");
|
||||
emit(`Restoring libsql from ${backupInput.backupFile}`);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, command);
|
||||
|
||||
@ -34,8 +34,9 @@ export const restoreMariadbBackup = async (
|
||||
});
|
||||
|
||||
emit("Starting restore...");
|
||||
|
||||
emit(`Executing command: ${command}`);
|
||||
emit(
|
||||
`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
|
||||
);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, command);
|
||||
|
||||
@ -34,8 +34,9 @@ export const restoreMongoBackup = async (
|
||||
});
|
||||
|
||||
emit("Starting restore...");
|
||||
|
||||
emit(`Executing command: ${command}`);
|
||||
emit(
|
||||
`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
|
||||
);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, command);
|
||||
|
||||
@ -33,8 +33,9 @@ export const restoreMySqlBackup = async (
|
||||
});
|
||||
|
||||
emit("Starting restore...");
|
||||
|
||||
emit(`Executing command: ${command}`);
|
||||
emit(
|
||||
`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
|
||||
);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, command);
|
||||
|
||||
@ -22,9 +22,6 @@ export const restorePostgresBackup = async (
|
||||
|
||||
const rcloneCommand = `rclone cat ${rcloneFlags.join(" ")} "${backupPath}" | gunzip`;
|
||||
|
||||
emit("Starting restore...");
|
||||
emit(`Backup path: ${backupPath}`);
|
||||
|
||||
const command = getRestoreCommand({
|
||||
appName,
|
||||
credentials: {
|
||||
@ -36,7 +33,10 @@ export const restorePostgresBackup = async (
|
||||
restoreType: "database",
|
||||
});
|
||||
|
||||
emit(`Executing command: ${command}`);
|
||||
emit("Starting restore...");
|
||||
emit(
|
||||
`Restoring database: ${backupInput.databaseName} from ${backupInput.backupFile}`,
|
||||
);
|
||||
|
||||
if (serverId) {
|
||||
await execAsyncRemote(serverId, command);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user