summaryrefslogtreecommitdiffstats
path: root/snap-src/bin
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-08-04 01:33:18 +0300
committerLauri Ojansivu <x@xet7.org>2019-08-04 01:33:18 +0300
commita7f7e00a142a9c2a5f4d37d739983d6841f6ae26 (patch)
tree9680a5a407eaa0ec5cb646b1c3bb10ddaf04e9e2 /snap-src/bin
parent5db3dcf8dac18fd4969b79611e86fb1202bd9f31 (diff)
downloadwekan-a7f7e00a142a9c2a5f4d37d739983d6841f6ae26.tar.gz
wekan-a7f7e00a142a9c2a5f4d37d739983d6841f6ae26.tar.bz2
wekan-a7f7e00a142a9c2a5f4d37d739983d6841f6ae26.zip
Try to fix Snap.
Diffstat (limited to 'snap-src/bin')
-rwxr-xr-xsnap-src/bin/mongodb-control3
-rwxr-xr-xsnap-src/bin/mongodb-restore2
2 files changed, 4 insertions, 1 deletions
diff --git a/snap-src/bin/mongodb-control b/snap-src/bin/mongodb-control
index d6d795bc..60d59657 100755
--- a/snap-src/bin/mongodb-control
+++ b/snap-src/bin/mongodb-control
@@ -30,3 +30,6 @@ fi
echo "mongodb bind options: $BIND_OPTIONS"
mongod --dbpath $SNAP_COMMON --logpath $SNAP_COMMON/mongodb.log --logappend --journal $BIND_OPTIONS --smallfiles
+
+# Drop indexes on database upgrade, when starting MongoDB
+mongo wekan --eval "db.getCollectionNames().forEach(function(col_name) { var coll = db.getCollection(col_name); coll.dropIndexes(); });" $BIND_OPTIONS
diff --git a/snap-src/bin/mongodb-restore b/snap-src/bin/mongodb-restore
index c1c82775..dddcea20 100755
--- a/snap-src/bin/mongodb-restore
+++ b/snap-src/bin/mongodb-restore
@@ -13,4 +13,4 @@ export LC_ALL=C
# start mongodb backup
[ "x" == "x${MONGODB_BIND_IP}" ] && MONGODB_BIND_IP="127.0.0.1"
echo "using bind ip"
-mongorestore --host $MONGODB_BIND_IP --port $MONGODB_PORT -d wekan --gzip --archive=$1
+mongorestore --host $MONGODB_BIND_IP --port $MONGODB_PORT -d wekan --noIndexRestore --gzip --archive=$1