Skip to content

Commit

Permalink
Change DB backup location
Browse files Browse the repository at this point in the history
closes #2887
- Stores content files under /content/data/
  • Loading branch information
jxhn committed Jun 11, 2014
1 parent da71009 commit c57bec7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/server/data/migration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var _ = require('lodash'),
schema = require('../schema').tables,
dataExport = require('../export'),
utils = require('../utils'),
config = require('../../config'),

schemaTables = _.keys(schema),

Expand Down Expand Up @@ -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));
});
Expand Down Expand Up @@ -179,4 +180,4 @@ module.exports = {
reset: reset,
migrateUp: migrateUp,
migrateUpFreshDb: migrateUpFreshDb
};
};

0 comments on commit c57bec7

Please sign in to comment.