Saturday, 13 August 2016

Post 62: Install nodeBB with redis

fork nodeBB project or clone it directly from nodeBB

git clone -b v1.x.x https://github.com/NodeBB/NodeBB.git nodebb

cd to nodeBB directory

install redis (this is installing a newer version than on the one that is already installed on c9):

sudo apt-add-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-server

//redis-server --port 16379 --bind $IP &

echo $IP


npm install


node app --setup


--> set url:
jubilee-c9-thadeuszlay.c9users.io
enter for nodeBB secret
for database: redis
set administrator name


node app

If you want to drop your redis database:
log into redis:
redis-cli
Once you are in redis you can type in either of those:
  • FLUSHDB - Removes data from your connection's CURRENT database.
  • FLUSHALL - Removes data from ALL databases.
To exit redis type in exit
-------------------------
It's always good to stay up-to-date of your nodeBB. If you want to upgrade 

1. Shut down your forum

$ cd /path/to/nodebb
$ ./nodebb stop

2. Back up your data

Redis

As with all upgrades, the first step is to back up your data! Nobody likes database corruption/misplacement.
All of the textual data stored in NodeBB is found in a .rdb file. On typical installs of Redis, the main database is found at /var/lib/redis/dump.rdb.

Avatars

Uploaded images (avatars) are stored in /public/uploads. Feel free to back up this folder too:
cd /path/to/nodebb/public
tar -czf ~/nodebb_assets.tar.gz ./uploads

3. Grab the latest and greatest code

$ git fetch    # Grab the latest code from the NodeBB Repository
$ git checkout v0.4.x    # Type this as-is! Not v0.4.2 or v0.4.3, but "v0.4.x"!
$ git merge origin/v0.4.x

If not upgrading between branches (e.g. v0.3.3 to v0.3.4, just run the following commands:
$ git fetch
$ git reset --hard origin/v0.3.x    # Replace v0.3.x with the branch name!
Don’t know what branch you are on? Execute git rev-parse --abbrev-ref HEAD to find out.

4. Run the NodeBB upgrade script

This script will install any missing dependencies, upgrade any plugins or themes (if an upgrade is available), and migrate the database if necessary.
$ ./nodebb upgrade
Note./nodebb upgrade is only available after v0.3.0. If you are running an earlier version, run these instead:
  • npm install
  • ls -d node_modules/nodebb* | xargs -n1 basename | xargs npm update
  • node app --upgrade

No comments:

Post a Comment

Tweet