Upgrading MongoDB schema (0.5.2-dev -> 0.7.0-dev)
-
Hey everyone,
Yes, it's a crazy upgrade, but I need it!
I will try to be as brief as possible.
Collections in my MongoDB (2.4.8): objects, posts, search, searchpost, searchtopic, sessions
schemaDate value: 1412640000000.000000Mongodump'ed and Mongorestore'd to another MongoDB database in MongoLab (2.6.9, therefore, textSearchEnabled=true by default).
Collections in my MongoDB (2.6.9): same as above
schemaDate value: 1392925500000.000000 - I think it's different because of some many failed attempts to ./nodebb upgradeWhat I did after that:
- git checkout v0.5.x, npm install, ./nodebb setup, configured with my 2.4.8 MongoDB, node app.js - NodeBB ran normally and updated schemaDate to 1413936000000.000000
- Mongodump'ed and Mongorestore'd again to 2.6.9 MongoDB - schemaDate changed to 1413936000000.000000 in my 2.6.9 MongoDB
- git checkout v0.6.x, rm -rf node_modules, npm install, ./nodebb setup, configured with my 2.6.9 MongoDB. Received a couple messages:
-- "No administrators have been detected, running initial user setup" - Created admin account with different username and email - Schema update complete! schemaDate: 1422576000000.000000
-- node app.js - Success: NodeBB running normally, but many Categories disappeared from my forum (had 8, only 1 was showing). Tried to login with the admin account created above and it logged, but no admin rights. Logged out, logged with previous admin account, received Admin rights and all 8 categories were shown again. Accessed ACP > Manage > Categories and noticed that all Categories had their privileges (Find category, Access & Read, Create Topics, Reply to Topics) disabled. Enabled them all for 1 category and it started showing again. I guess this is a minor issue, so let's go back to updating to 0.7.0-dev - git checkout origin/master (commit: 93df7f14d88bd40f88e78c5a39b04975b28b751e), rm -rf node_modules, npm install, ./nodebb setup, again configured with my 2.6.9 MongoDB. Received many warnings after the line "info: [2015/2/23] Activating NodeBB Essential Rewards"
"warn: [plugins/nodebb-plugin-mentions] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing." - Same message for other 4-5 plugins: nodebb-theme-lavender, nodebb-plugin-soundpack-default, nodebb-rewards-essentials
-- Error after line "info: [2015/02/24] Upgrading plugins:active to sorted set done"
C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\lib\utils.js:97 process.nextTick(function() { throw err; }); ^ TypeError: Cannot read property 'length' of undefined at Object.async.eachSeries (C:\Users\X\Desktop\openshift\NodeBB\node_modules\async\lib\async.js:141:17) at C:\Users\X\Desktop\openshift\NodeBB\src\upgrade.js:903:13 at C:\Users\X\Desktop\openshift\NodeBB\src\database\mongo\main.js:103:4 at handleCallback (C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\lib\utils.js:95:12) at C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\lib\collection.js:763:5 at C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\replset.js:371:5 at C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:795:13 at Callbacks.emit (C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:94:3) at null.messageHandler (C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\node_modules\mongodb-core\lib\topologies\server.js:235:23) at Socket.<anonymous> (C:\Users\X\Desktop\openshift\NodeBB\node_modules\mongodb\node_modules\mongodb-core\lib\connection\connection.js:259:22)
-- Ignored error. Checked schemaDate: 1424736000000.000000, therefore, it got updated.
-- Tried running NodeBB and I was told to ./nodebb upgrade. Did it, received message: Schema update complete!
-- Tried running again, node app.js - Success - Checked schemaDate: 1431302400000.000000
-- Opened the forum and noticed my HTML Widget at the top was missing. Logged with old admin account - had Admin rights normally. Opened ACP and changed theme to Persona - Worked just fine
-- Investigated Widget issue. ACP > Extend > Widgets and no widgets were found, however, I'm stuck with a light-blue empty div on the top of my NodeBB forum.The funny thing is that I wrote this post while testing everything on my side and expected it to fail because yesterday I tried the same steps and the outcome was quite different: I didn't even manage to run 0.7.0-dev. So yeah, I guess I could just erase all my post and just leave the "light-blue div issue", but I think my use case might be useful for someone. If not, feel free to edit my post.
Anyways, that's basically the entire process that I went through. I will keep investigating the light-blue widget and post here if I managed to remove it. Other than that, all I can say is that you guys did an amazing job with NodeBB and... Persona theme is cute
(one of the reasons why I updated everything lol)
Regards!
-
Nevermind about the light-blue empty <div>. I simply re-activated nodebb-widget-essentials and it appeared normally again. Well, I guess this thread had no use at all
By the way, only those 2 categories with all Privileges enabled are showing. The other 6 are still hidden and only shown to Admin. Not a big issue: I just need to change all privileges again.
Take care!
-
Haha I think I need the tl;dr version here please. Everything okay with your instance now?
-
@psychobunny Yes it is
Well, that was just the entire upgrade process from 0.5.2-dev to 0.7.0-dev hahaha So I guess this thread will only serve as a "tutorial" or feedback lol... But yeah, everything's fine and running smooth! Had to rebase 33 commits on top of your master branch but all good... so far