From b1ff826a617a7bb39aaff0a695fb73e08362e019 Mon Sep 17 00:00:00 2001
From: Daniel Lockyer <hi@daniellockyer.com>
Date: Mon, 27 Feb 2023 16:19:15 +0100
Subject: [PATCH] Removed Bluebird from DB backup file

refs https://github.com/TryGhost/Ghost/issues/14882

- we're slowly moving away from Bluebird and don't need it here to
  achieve what we need
---
 ghost/core/core/server/data/db/backup.js | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/ghost/core/core/server/data/db/backup.js b/ghost/core/core/server/data/db/backup.js
index 8159593a9b..c39e4258da 100644
--- a/ghost/core/core/server/data/db/backup.js
+++ b/ghost/core/core/server/data/db/backup.js
@@ -3,7 +3,6 @@
 const fs = require('fs-extra');
 
 const path = require('path');
-const Promise = require('bluebird');
 const config = require('../../../shared/config');
 const logging = require('@tryghost/logging');
 const urlUtils = require('../../../shared/url-utils');
@@ -40,23 +39,24 @@ const readBackup = async (filename) => {
 };
 
 /**
- * ## Backup
- * does an export, and stores this in a local file
- * @returns {Promise<*>}
+ * Does an export, and stores this in a local file
+ *
+ * @param {Object} options
+ * @returns {Promise<String>}
  */
 const backup = async function backup(options = {}) {
     logging.info('Creating database backup');
 
-    const props = {
-        data: exporter.doExport(options),
-        filename: exporter.fileName(options)
-    };
+    const filename = await exporter.fileName(options);
+    const data = await exporter.doExport(options);
 
-    const exportResult = await Promise.props(props);
-    const filename = await writeExportFile(exportResult);
+    const filePath = await writeExportFile({
+        data,
+        filename
+    });
 
-    logging.info('Database backup written to: ' + filename);
-    return filename;
+    logging.info(`Database backup written to ${filePath}`);
+    return filePath;
 };
 
 module.exports = {