mmmWiki setup mysql

Setting up mmmWiki

DISCLAIMER: The software is offered as is.


To run the software locally /

Risk of getting stuck
/ making an error
Medium Install Node.js (Google it (Personally I use the "Installing Node.js via binary archive on Linux"-insturctions from
Risky Install MySQL or MariaDB. (MariaDB seem to support TLS which MySql doesn't. On the other hand MySQL Workbench says they might not support MariaDB. Personally I use MariaDB.)
Medium Install Redis (they have pretty good "quick start"-instructions (ref))
Small Download the files: git (use the mysql branch)
Medium In the extracted folder: Run npm install. (This will download the required packages ).
Medium Create a file config.js (for example by copying and editing config.example.js). Read the comments (follow the instructions) of the file. config.example.js
Small execute node script.js --sql createTable

execute node script.js --sql createView

execute node script.js --sql createFunction

execute node script.js --sql populateSetting (insert some values in the "setting"-table)

(run node script.js -h for more options (like deleteTable, deleteFunction ...) (see also below))

Small Create a site.csv-file in a directory "mmmWikiBU" (BU=BackUp) parallel to the "mmmWiki" folder (the extracted folder). (Trying to illustrate it:)

*(parent directory)
***(if you make a real backup later, then more files will be here)
site.csv is csv (comma separated values) with the property names on the first row.

Examples of a site.csv file:

... or if you are testing locally:
One and only one row should have boDefault=true.

The "aPassword" and "vPassword"-variables aren't used so those can be left empty. (There are "aPassword" and "vPassword"-variables in the config.js-file however.)

Small execute node script.js --load site.csv

(This will load the site.csv-file created above.)

Check below if you want to undo it.

Small Start the app (By executing node script.js for example)

In production you might want the app to start automatically after reboot and after crash. To do this I personally use pm2.

Starting with a backup

Follow the instructions above.

Instead of executing "node script.js --load site.csv", execute:

node script.js --load (this will load all the files that constitute the backup: site.csv,,, page.csv, image.csv, redirect.csv)

Delete everything from the databases

Ex 1 (delete everything):
node script.js --sql dropFunction (drops all functions)
node script.js --sql dropView (drops all views)
node script.js --sql dropTable (drops all tables)
Ex 2:
node script.js --sql truncate (This command empties all the database tables (But the tables are still there (as well as views and functions)))
See node script.js --help for more options.

TLS (SSL (https))

This is a story of its own.

I'm currently using nginx as a reverse proxy which is able to handle TLS.

I'm using letsencrypt as certificate authority.

See also