How to use the database without destroying Discourse?

See examples on the source code of some plugins: