Skip to content

Commit

Permalink
Create man page for cnid2_create tool, GitHub#402
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Aug 27, 2023
1 parent f48869c commit 57c929d
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/manual/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ manpages = manpages/ad.1 \
manpages/afppasswd.1 \
manpages/apple_dump.1 \
manpages/asip-status.1 \
manpages/cnid2_create.1 \
manpages/dbd.1 \
manpages/getzones.1 \
manpages/macusers.1 \
Expand Down
132 changes: 132 additions & 0 deletions doc/manual/man/man1/cnid2_create.1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="cnid2_create.1">
<refmeta>
<refentrytitle>cnid2_create</refentrytitle>

<manvolnum>1</manvolnum>

<refmiscinfo class="date">08 Aug 2023</refmiscinfo>

<refmiscinfo class="source">:NETATALK_VERSION:</refmiscinfo>
</refmeta>

<refnamediv>
<refname>cnid2_create</refname>

<refpurpose>Convert CNID 1 database to CNID 2</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>cnid2_create</command>

<arg choice="plain"><replaceable>volume</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsect1>
<title>DESCRIPTION</title>

<para><command>cnid2_create</command> converts a CNID database created
with Netatalk 1 to a CNID database compatible with Netatalk 2.</para>

<note>
<para>This section is borrowed with minor modification
from the Upgrade guide in the Netatalk 2 manual.</para>
</note>

<para>The steps to upgrade depend on what version of Berkeley DB is
installed on your system. If you already use one of the supported
versions of Berkeley DB (4.1.25 or 4.2.52) for your old Netatalk
installation and plan to use it for Netatalk 2 as well, just use the
<command>db_dump</command> and <command>db_load</command> utilities that
came with it as indicated below. Otherwise it is probably best to have
the old and the new (to be used with Netatalk 2) version of Berkeley
DB installed side by side until you have finished the upgrade. The
reason for this is that we will dump out the old databases with the
currently installed version of Berkeley DB in ASCII format and reload
them with the new version. This avoids any incompatibility problems
between Berkeley DB releases with respect to the on-disk format.</para>

<para>For each volume to be upgraded, follow these steps <itemizedlist>
<listitem>
<para>Stop all afpd daemons accessing the volume.</para>
</listitem>

<listitem>
<para>Change to the database directory for that volume, most
likely the <filename>.AppleDB</filename> subdirectory of the
volume toplevel directory in question.</para>
</listitem>

<listitem>
<para>Dump the contents of <filename>cnid.db</filename> and
<filename>didname.db</filename> using the old (installed) version
of Berkeley DB like this:</para>

<programlisting> db_dump -f cnid.dump cnid.db
db_dump -f didname.dump didname.db</programlisting>

<para>Make sure the db_dump utility you are using is the correct
(currently used) one. Use the full path to the db_dump executable
if in doubt. So if this database was created with Berkeley DB 3.xx
installed in <filename>/usr/local/db3</filename> use
<filename>/usr/local/db3/bin/db_dump</filename> instead. This will
create two files, <filename>cnid.dump</filename> and
<filename>didname.dump</filename> in the current directory.</para>
</listitem>

<listitem>
<para>Run the cnid2_create script:</para>

<programlisting> cnid2_create </programlisting>

<para>The script assumes that <filename>.AppleDB</filename> is a
subdirectory of the volume directory to be upgraded. If that is
not the case give the full path name of the volume as the first
argument to <command>cnid2_create</command>. The script will
create a file <filename>cnid2.dump</filename> in ASCII
format.</para>
</listitem>

<listitem>
<para>Remove the old Berkeley DB environment and logfiles (if
present):</para>

<programlisting> rm __db.* log.*</programlisting>
</listitem>

<listitem>
<para>Load <filename>cnid2.dump</filename> into the new database.
You should use the <command>db_load</command> utility of Berkeley
DB that will be used with version 2 of Netatalk. So if Berkeley
DB 4.xx lives in <filename>/usr/local/db4</filename> use</para>

<programlisting> /usr/local/db4/bin/db_load -f cnid2.dump cnid2.db </programlisting>

<para>This will create the new database file,
<filename>cnid2.db</filename>. Remove the old database files
<filename>cnid.db</filename>, <filename>didname.db</filename> and
<filename>devino.db</filename>. The intermediate files
<filename>cnid.dump</filename>, <filename>didname.dump</filename>
and <filename>cnid2.dump</filename> can be removed now or at some
later time.</para>
</listitem>
</itemizedlist></para>

<para>If you do not want to have two versions of Berkeley DB installed
side by side during the upgrade, you should first dump out the old
databases as indicated above for all volumes, upgrade Berkeley DB and
then load them with db_load. The <command>cnid2_create</command> script
can be run before or after the upgrade. Berkeley DB environment and
logfiles should still be removed before running
<command>db_load</command>.</para>
</refsect1>

<refsect1>
<title>SEE ALSO</title>

<para><citerefentry><refentrytitle>apple_dump</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
<para><citerefentry><refentrytitle>dbd</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
</refsect1>
</refentry>
3 changes: 3 additions & 0 deletions doc/manual/manual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<!ENTITY afpd.8 SYSTEM "man/man8/afpd.8.xml">
<!ENTITY cnid_dbd.8 SYSTEM "man/man8/cnid_dbd.8.xml">
<!ENTITY cnid_metad.8 SYSTEM "man/man8/cnid_metad.8.xml">
<!ENTITY cnid2_create.1 SYSTEM "man/man1/cnid2_create.1.xml">
<!ENTITY papd.8 SYSTEM "man/man8/papd.8.xml">
<!ENTITY papstatus.8 SYSTEM "man/man8/papstatus.8.xml">
<!ENTITY psf.8 SYSTEM "man/man8/psf.8.xml">
Expand Down Expand Up @@ -124,6 +125,8 @@ url="http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt">http://www.gnu.org/li

&cnid_metad.8;

&cnid2_create.1;

&dbd.1;

&getzones.1;
Expand Down
1 change: 1 addition & 0 deletions man/man1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ Makefile
Makefile.in
asip-status.1
afpldaptest.1
cnid2_create.1
uniconv.1
*.o
10 changes: 8 additions & 2 deletions man/man1/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ SUFFIXES= .tmpl .
-e s@:DEFAULT_CNID_SCHEME:@${DEFAULT_CNID_SCHEME}@ \
<$< >$@

GENERATED_MANS = uniconv.1 asip-status.1 afpldaptest.1
TEMPLATE_FILES = uniconv.1.tmpl asip-status.1.tmpl afpldaptest.1.tmpl
GENERATED_MANS = uniconv.1 \
asip-status.1 \
afpldaptest.1 \
cnid2_create.1
TEMPLATE_FILES = uniconv.1.tmpl \
asip-status.1.tmpl \
afpldaptest.1.tmpl \
cnid2_create.1.tmpl
NONGENERATED_MANS = ad.1 \
afppasswd.1 \
apple_dump.1 \
Expand Down

0 comments on commit 57c929d

Please sign in to comment.