summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McLear <john@mclear.co.uk>2012-10-25 09:40:33 -0700
committerJohn McLear <john@mclear.co.uk>2012-10-25 09:40:33 -0700
commitff2e7ead0982b4db01680536ff3392b1abe2a02a (patch)
treeb51ca5841bef49e79df75c31868e6c5411eb35e1
parent344ba31c921d77f7ef17ce4ff02a930c7133db76 (diff)
downloadetherpad-lite-ff2e7ead0982b4db01680536ff3392b1abe2a02a.zip
add a script to migrate from dirtyDB to MYSQL thanks to http://blog.codeborne.com
-rw-r--r--bin/migrateDirtyDBtoMySQL.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/migrateDirtyDBtoMySQL.js b/bin/migrateDirtyDBtoMySQL.js
new file mode 100644
index 00000000..f2bc8efe
--- /dev/null
+++ b/bin/migrateDirtyDBtoMySQL.js
@@ -0,0 +1,11 @@
+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);
+ });
+ });
+});