
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@ben_lubar/nodebb-postgres-converter
Advanced tools
Converts an existing NodeBB NoSQL database to a relational PostgreSQL database.
Converts an existing NodeBB NoSQL database to a relational PostgreSQL database.
See also: https://gist.github.com/BenLubar/dd816c736a9a1cbd70e3469828b96e5d
Download nodebb-postgres-converter, either by cloning this repository and
running npm install or by installing globally with the command
npm install -g @ben_lubar/nodebb-postgres-converter
Make a backup of your NodeBB database and decide whether you'd prefer downtime or the loss of data more recent than your backup. In the future, there will be a plugin that will record changes made to the live database and then play them back on the converted database.
Set up your destination database. This can be any of the supported database types listed above. If you decided to keep the forum running during this process, set up another copy of your source database(s) from the backup.
Database connection URLs follow the same format no matter which database you're
using: type://username:password@ip:port/database
redis, mongodb, or postgresql:password part or the entire authentication
section of the URL.0 for Redis and nodebb for MongoDB and PostgreSQL. For a
PostgreSQL destination, the database must already be created.Disabling certain safety features in a PostgreSQL destination database will improve performance. Just remember to turn them back on before going live.
Try running these commands:
ALTER SYSTEM SET wal_level = 'minimal';
ALTER SYSTEM SET archive_mode = 'off';
ALTER SYSTEM SET max_wal_senders = 0;
ALTER SYSTEM SET autovacuum = 'off';
Followed by restarting the PostgreSQL database before the conversion. After the
conversion, run ALTER SYSTEM RESET ALL and restart the database again.
Disabling these features would normally make your database vulnerable to data loss during a power failure or a crash, but if the conversion process is interrupted, you can just start over from the backup.
Now that you're ready, run the command:
bin/converter.js if you cloned the repository or
nodebb-postgres-converter if you installed globally.--outputType,
--output), and you need the object database (--type, --input) or the
session database (--sessionType, --sessionInput) or both.
redis, mongo, or postgres, following NodeBB's database
naming convention.--memory 4GB
will make the conversion go faster by temporarily allowing PostgreSQL to use
up to 4GB of memory for maintenance tasks. PostgreSQL allows 64MB of memory
by default, so for a large forum, creating indexes and clustering the data
will take a long time without increasing the memory limit.If you are running the command remotely (such as over SSH), I suggest using a
program like screen to separate the conversion process from your SSH session,
so that the conversion process can continue if your SSH connection is lost.
A complete command looks like this:
nodebb-postgres-converter \
--type mongo --input 'mongodb://localhost/nodebb-copy' \
--sessionType redis --input 'redis://localhost/0' \
--outputType postgres --output 'postgresql://localhost/nodebb' \
--memory 12GB
FAQs
Converts an existing NodeBB NoSQL database to a relational PostgreSQL database.
We found that @ben_lubar/nodebb-postgres-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.