diff --git a/client/components/tables/BackupsTable.vue b/client/components/tables/BackupsTable.vue index f4ab1e7d..a216f463 100644 --- a/client/components/tables/BackupsTable.vue +++ b/client/components/tables/BackupsTable.vue @@ -21,15 +21,14 @@ {{ $bytesPretty(backup.fileSize) }}
- {{ $strings.ButtonRestore }} - - - + {{ $strings.ButtonRestore }} error_outline - + + +
diff --git a/server/managers/BackupManager.js b/server/managers/BackupManager.js index 7a61406f..caedd567 100644 --- a/server/managers/BackupManager.js +++ b/server/managers/BackupManager.js @@ -180,8 +180,10 @@ class BackupManager { const backup = new Backup({ details, fullPath: fullFilePath }) - if (!backup.serverVersion) { - Logger.error(`[BackupManager] Old unsupported backup was found "${backup.fullPath}"`) + if (!backup.serverVersion) { // Backups before v2 + Logger.error(`[BackupManager] Old unsupported backup was found "${backup.filename}"`) + } else if (!backup.key) { // Backups before sqlite migration + Logger.warn(`[BackupManager] Old unsupported backup was found "${backup.filename}" (pre sqlite migration)`) } backup.fileSize = await getFileSize(backup.fullPath) diff --git a/server/objects/Backup.js b/server/objects/Backup.js index da0df4eb..e3b9f4b4 100644 --- a/server/objects/Backup.js +++ b/server/objects/Backup.js @@ -5,6 +5,7 @@ const version = require('../../package.json').version class Backup { constructor(data = null) { this.id = null + this.key = null // Special key for pre-version checks this.datePretty = null this.backupDirPath = null @@ -24,7 +25,7 @@ class Backup { get detailsString() { const details = [] details.push(this.id) - details.push('1') // Unused old boolean spot + details.push(this.key) details.push(this.createdAt) details.push(this.serverVersion) return details.join('\n') @@ -32,6 +33,9 @@ class Backup { construct(data) { this.id = data.details[0] + this.key = data.details[1] + if (this.key == 1) this.key = null // v2.2.23 and below backups stored '1' here + this.createdAt = Number(data.details[2]) this.serverVersion = data.details[3] || null @@ -46,6 +50,7 @@ class Backup { toJSON() { return { id: this.id, + key: this.key, backupDirPath: this.backupDirPath, datePretty: this.datePretty, fullPath: this.fullPath, @@ -59,6 +64,7 @@ class Backup { setData(backupDirPath) { this.id = date.format(new Date(), 'YYYY-MM-DD[T]HHmm') + this.key = 'sqlite' this.datePretty = date.format(new Date(), 'ddd, MMM D YYYY HH:mm') this.backupDirPath = backupDirPath