0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Change DB backup location

closes #2887
- Stores content files under /content/data/
This commit is contained in:
jomahoney 2014-06-11 21:16:21 +01:00
parent da710091eb
commit c57bec7906

View file

@ -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
};
};