Change database dump format + add import & export scripts

The new format allows for downloading and importing only a part of the
database - useful when only the metadata is required - and doesn't
include the wasteful preformatted HTML cache.

This also ensures that the new import.sql script is actually usable and
in sync with the actual database. The old schema.sql was neither.

(And this simplifies my backup scripts)
This commit is contained in:
Yorhel 2025-10-08 09:40:50 +02:00
parent 23b2686672
commit 902048e282
8 changed files with 273 additions and 141 deletions

View file

@ -496,19 +496,14 @@ FU::get '/info/about' => sub {
<h2 id="database-download">Database download</h2>
<p>
This site is backed by a PostgreSQL database containing all the man pages.
Weekly dumps of the full database are available for download at
<a href="http://dl.manned.org/dumps/">http://dl.manned.org/dumps/</a>.
This site is backed by a PostgreSQL database containing all the metadata
and man pages. Weekly dumps of the full database are available for
download at <a href="https://dl.manned.org/">https://dl.manned.org/</a>.
<br /><br />
Be warned that the download server may not be terribly fast or reliable,
so it is advisable to use a client that supports resumption of partial
downloads. See <a href="/wget">wget's -c</a> or
<a href="/curl">curl's -C</a>.
<br /><br />
The database schema is "documented" at <a
href="https://code.blicky.net/yorhel/manned/src/branch/master/schema.sql">schema.sql</a>
in the git repo. Keep in mind that these dumps don't constitute a stable
API and, while this won't happen frequently, incompatible schema changes
The database schema is "documented" in <a
href="https://code.blicky.net/yorhel/manned/src/branch/master/import.sql">import.sql</a>.
Keep in mind that these dumps don't constitute a stable API and, while
this won't happen frequently, incompatible schema changes, format changes
or Postgres major version bumps will occassionally occur.
</p>