From c57bec7906e1a970d918847d19c1c934d1cfed1b Mon Sep 17 00:00:00 2001 From: jomahoney Date: Wed, 11 Jun 2014 21:16:21 +0100 Subject: [PATCH] Change DB backup location closes #2887 - Stores content files under /content/data/ --- core/server/data/migration/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/server/data/migration/index.js b/core/server/data/migration/index.js index 92e4b4f9da..e661cab44b 100644 --- a/core/server/data/migration/index.js +++ b/core/server/data/migration/index.js @@ -14,6 +14,7 @@ var _ = require('lodash'), schema = require('../schema').tables, dataExport = require('../export'), utils = require('../utils'), + config = require('../../config'), schemaTables = _.keys(schema), @@ -136,7 +137,7 @@ function checkMySQLPostTable() { function backupDatabase() { return dataExport().then(function (exportedData) { // Save the exported data to the file system for download - var fileName = path.resolve(__dirname + '/../exported-' + (new Date().getTime()) + '.json'); + var fileName = path.resolve(config().paths.contentPath + '/data/exported-' + (new Date().getTime()) + '.json'); return nodefn.call(fs.writeFile, fileName, JSON.stringify(exportedData)); }); @@ -179,4 +180,4 @@ module.exports = { reset: reset, migrateUp: migrateUp, migrateUpFreshDb: migrateUpFreshDb -}; \ No newline at end of file +};