'\" t
.\"     Title: DBUPGRADE
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 08/28/2023
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "DBUPGRADE" "nged" "08/28/2023" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
dbupgrade \- Upgrade the currently open BRL\-CAD mged geometry database to the current geometry database format version\&.
.SH "SYNOPSIS"
.HP \w'\fBdbupgrade\fR\ 'u
\fBdbupgrade\fR
.SH "DESCRIPTION"
.PP
\fBdbupgrade\fR
operates on the currently open input geometry databasefile in MGED\&. After dbupgrade is complete, the working database will be upgraded and a backup file will be saved preserving the original "pre\-upgrade" version of the \&.g file\&. Keep the backup file until it is clear all necessary information was successfully preserved\&.
.PP
Starting with v5, the geometry file format is platform independent\&. For v4 \&.g files, however, there is a potential problem in that the floating point storage format within the file is platform dependent\&. Consequently the safest way to upgrade a v4 file is to run
\fBdbupgrade\fR
on the file before transferring it from the platform on which it was created\&. If that system is no longer available, the
\fBdbupgrade\fR
will attempt to automatically \*(Aqfix\*(Aq an existing (v4 format) binary database that was transferred from a binary\-incompatible platform\&.
.PP
The older process of running
\fBg2asc\fR(1)
and
\fBasc2g\fR(1)
on a database to preserve a text version as a work\-around for platform specific binary files is no longer necessary\&.
.SH "SEE ALSO"
.PP
\fBmged\fR(1),
\fBg2asc\fR(1),
\fBasc2g\fR(1)\&.
.SH "DIAGNOSTICS"
.PP
Numerous error conditions are possible, usually due to errors in the geometry database\&. In the case of a binary\-incompatible v4 file, some errors may reflect incomplete conversion code\&. Descriptive messages are printed on standard error (file descriptor 2)\&.
.PP
\fBExample\ \&1.\ \&Binary Incompatible v4 .g File Upgrade from MGED\fR
.sp
.if n \{\
.RS 4
.\}
.nf

bash4\&.0$ \fBmged \-c \-a nu model\&.g\fR
BRL\-CAD Release 7\&.22\&.1  Geometry Editor (MGED)
    Fri, 08 Feb 2013 15:36:52 \-0500, Compilation 0
    user@machine:/usr/brlcad/dev\-7\&.22\&.1

WARNING: Binary\-incompatible v4 geometry database detected\&.
Endianness flipped\&.  Converting to READ ONLY\&.
Opened in READ ONLY mode
/home/user/model\&.g: READ ONLY
Historical Model (units=in)

mged> \fBdbupgrade\fR
upgrade, cancel, or help? [default: help] \fBupgrade\fR
mged> \fBq\fR
bash4\&.0$ \fBls\fR
model\&.g model\&.g\&.R4\&.g

.fi
.if n \{\
.RE
.\}
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "COPYRIGHT"
.PP
This software is Copyright (c) 2006\-2023 by the United States Government as represented by U\&.S\&. Army Research Laboratory\&.
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
