summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-08-24 13:31:02 +0100
committerPeter 'Pita' Martischka <petermartischka@googlemail.com>2011-11-25 17:56:50 -0800
commit6bcd2886e9bec06ed47a0d3ee3f1a98831178b98 (patch)
treeccb524d759fc2d31867e9199a340a92d35465304 /bin
parent932ad0eeeb96d2eb75b29aa4e27fe89378089059 (diff)
downloadetherpad-lite-6bcd2886e9bec06ed47a0d3ee3f1a98831178b98.zip
Fixed some problems with the database convertion
Diffstat (limited to 'bin')
-rw-r--r--bin/convert.js56
-rw-r--r--bin/convertSettings.json.template2
2 files changed, 38 insertions, 20 deletions
diff --git a/bin/convert.js b/bin/convert.js
index 94e9877a..d410f7a4 100644
--- a/bin/convert.js
+++ b/bin/convert.js
@@ -52,7 +52,7 @@ async.series([
{
log("get all padIds out of the database...");
- etherpadDB.query("SELECT ID FROM PAD_META LIMIT", [], function(err, _padIDs)
+ etherpadDB.query("SELECT ID FROM PAD_META", [], function(err, _padIDs)
{
padIDs = _padIDs;
callback(err);
@@ -153,11 +153,14 @@ function convertPad(padId, callback)
{
if(!err)
{
- //parse the pages
- for(var i=0,length=results.length;i<length;i++)
+ try
{
- parsePage(chatMessages, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
- }
+ //parse the pages
+ for(var i=0,length=results.length;i<length;i++)
+ {
+ parsePage(chatMessages, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
+ }
+ }catch(e) {err = e}
}
callback(err);
@@ -172,11 +175,14 @@ function convertPad(padId, callback)
{
if(!err)
{
- //parse the pages
- for(var i=0,length=results.length;i<length;i++)
+ try
{
- parsePage(changesets, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, false);
- }
+ //parse the pages
+ for(var i=0,length=results.length;i<length;i++)
+ {
+ parsePage(changesets, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, false);
+ }
+ }catch(e) {err = e}
}
callback(err);
@@ -191,11 +197,14 @@ function convertPad(padId, callback)
{
if(!err)
{
- //parse the pages
- for(var i=0,length=results.length;i<length;i++)
+ try
{
- parsePage(changesetsMeta, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
- }
+ //parse the pages
+ for(var i=0,length=results.length;i<length;i++)
+ {
+ parsePage(changesetsMeta, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
+ }
+ }catch(e) {err = e}
}
callback(err);
@@ -210,7 +219,10 @@ function convertPad(padId, callback)
{
if(!err)
{
- apool=JSON.parse(results[0].JSON).x;
+ try
+ {
+ apool=JSON.parse(results[0].JSON).x;
+ }catch(e) {err = e}
}
callback(err);
@@ -225,11 +237,14 @@ function convertPad(padId, callback)
{
if(!err)
{
- //parse the pages
- for(var i=0, length=results.length;i<length;i++)
+ try
{
- parsePage(authors, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
- }
+ //parse the pages
+ for(var i=0, length=results.length;i<length;i++)
+ {
+ parsePage(authors, results[i].PAGESTART, results[i].OFFSETS, results[i].DATA, true);
+ }
+ }catch(e) {err = e}
}
callback(err);
@@ -244,7 +259,10 @@ function convertPad(padId, callback)
{
if(!err)
{
- padmeta = JSON.parse(results[0].JSON).x;
+ try
+ {
+ padmeta = JSON.parse(results[0].JSON).x;
+ }catch(e) {err = e}
}
callback(err);
diff --git a/bin/convertSettings.json.template b/bin/convertSettings.json.template
index bdd4e499..d7aa9c23 100644
--- a/bin/convertSettings.json.template
+++ b/bin/convertSettings.json.template
@@ -1,5 +1,5 @@
{
- "etherpad-db":
+ "etherpadDB":
{
"host": "localhost",
"port": 3306,