Skip to documentation
DocumentationAll documentsEnglish

DBUPGRADE(1)

NAME

dbupgrade - upgrade a BRL-CAD geometry database to the current version

On this page

SYNOPSIS

dbupgrade [-f] [-r] [-h] [-?] input.g output.g

DESCRIPTION

dbupgrade reads an older BRL-CAD geometry database (input.g), upgrades it to the current database version (v5), and writes the result to a new file (output.g). The input is opened read-only and is never modified. The output file must not already exist.

The v5 database format is platform-independent, so upgrading eliminates the need to use g2asc(1) and asc2g(1) to transfer databases between different computer architectures.

In addition to changing the on-disk format, dbupgrade converts obsolete geometry types and properties. Heightfields (HF) are converted to displacement maps (DSP), polysolids (POLY) to bag-of-triangles (BOT), and NURB B-splines (BSPLINE) to boundary representations (BREP). Old "plastic" shader names are rewritten as "phong", and any v4 material color table is migrated into the regionid_colortable global attribute. Objects that fail to convert are reported on standard error and the remaining objects are still written.

OPTIONS

-f

Force the operation. Normally dbupgrade halts with a warning if the input is already at the current version (an upgrade) or is not v5 (a revert). This option forces the conversion to proceed anyway (e.g. v5 to v5, applying only the geometry-type updates).

-r

Revert the database to the older v4 format instead of upgrading. The input must be a v5 database (unless combined with -f). Objects that have no v4 equivalent are skipped and reported.

-h, -?

Print a usage message and exit.

EXAMPLES

Example 1. Upgrade an old database to the current format
dbupgrade legacy_v4.g model.g

Reads the v4 database legacy_v4.g and writes a current v5 database model.g, converting any heightfields, polysolids, and B-splines along the way.

Example 2. Refresh a current database in place of obsolete geometry
dbupgrade -f model.g model_updated.g && mged model_updated.g

Forces dbupgrade to rewrite the already-v5 model.g, applying the internal geometry-type conversions (for example, polysolids to BOTs) even though the format version does not change, then opens the result in mged(1).

SEE ALSO

brlcad(1), mged(1), g2asc(1), asc2g(1)

DIAGNOSTICS

Numerous error conditions are possible, usually due to errors in the geometry database. Descriptive messages are printed on standard error (file descriptor 2), and a count of objects that failed to convert is reported when finished.

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org