summaryrefslogtreecommitdiff
path: root/bin/migrateDirtyDBtoMySQL.js
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2012-11-09 22:06:26 +0100
committerMarcel Klehr <mklehr@gmx.net>2012-11-09 22:06:26 +0100
commitb057759eae7a15b41e4f50539d4d5e6f54a5d780 (patch)
treeb4d1f86eb98236ca3169833cacc047d0e5e24671 /bin/migrateDirtyDBtoMySQL.js
parentdc3db7a4a8953167561f5aa39a23830a620da5c9 (diff)
downloadetherpad-lite-b057759eae7a15b41e4f50539d4d5e6f54a5d780.zip
Fix #1142 error in bin/migrateDirtyDBtoMySQL.js
npm must be npm.load'ed before using it
Diffstat (limited to 'bin/migrateDirtyDBtoMySQL.js')
-rw-r--r--bin/migrateDirtyDBtoMySQL.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/migrateDirtyDBtoMySQL.js b/bin/migrateDirtyDBtoMySQL.js
index f2bc8efe..d0273de0 100644
--- a/bin/migrateDirtyDBtoMySQL.js
+++ b/bin/migrateDirtyDBtoMySQL.js
@@ -1,11 +1,17 @@
-var dirty = require("../src/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
-var db = require("../src/node/db/DB");
-
-db.init(function() {
- db = db.db;
- dirty.on("load", function() {
- dirty.forEach(function(key, value) {
- db.set(key, value);
+require("ep_etherpad-lite/node_modules/npm").load({}, function(er,npm) {
+
+ process.chdir(npm.root+'/..')
+
+ var dirty = require("ep_etherpad-lite/node_modules/ueberDB/node_modules/dirty")('var/dirty.db');
+ var db = require("ep_etherpad-lite/node/db/DB");
+
+ db.init(function() {
+ db = db.db;
+ dirty.on("load", function() {
+ dirty.forEach(function(key, value) {
+ db.set(key, value);
+ });
});
});
+
});