1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry id="uniconv.1">
5 <refentrytitle>uniconv</refentrytitle>
7 <manvolnum>1</manvolnum>
9 <refmiscinfo class="date">19 Jan 2013</refmiscinfo>
11 <refmiscinfo class="source">@NETATALK_VERSION@</refmiscinfo>
15 <refname>uniconv</refname>
17 <refpurpose>convert Netatalk volume encoding</refpurpose>
22 <command>uniconv<indexterm><primary>uniconv</primary></indexterm></command>
24 <arg choice="opt">-ndv</arg>
26 <arg choice="plain">-c <replaceable>cnidbackend</replaceable></arg>
28 <arg choice="plain">-f <replaceable>fromcode</replaceable></arg>
30 <arg choice="plain">-t <replaceable>tocode</replaceable></arg>
32 <arg>-m <replaceable>maccode</replaceable></arg>
34 <arg choice="plain"><replaceable>volumepath</replaceable></arg>
39 <title>Description</title>
41 <para><command>uniconv</command> converts the volume encoding of
42 <replaceable>volumepath</replaceable> from the <replaceable>fromcode</replaceable>
43 to the <replaceable>tocode</replaceable> encoding.</para>
47 <title>Options</title>
54 <para>CNID backend used on this volume, usually cdb or dbd. Should
55 match the backend selected with afpd for this volume. If not
56 specified, the default CNID backend "@DEFAULT_CNID_SCHEME@" is
65 <para>don't HEX encode leading dots (:2e), equivalent to
66 <option>use dots = yes</option> in <citerefentry><refentrytitle>afp.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry></para>
74 <para>encoding to convert from, use ASCII for HEX encoded volumes</para>
82 <para>display help</para>
90 <para>Macintosh client codepage, required for HEX encoded volumes.
91 Defaults to "MAC_ROMAN"</para>
99 <para>"dry run", don't do any real changes</para>
107 <para>volume encoding to convert to, e.g. UTF8</para>
115 <para>verbose output, use twice for maximum logging.</para>
123 <para>print version and exit</para>
132 <title>WARNING</title>
134 <para>Setting the wrong options might render your data unusable!!! Make
135 sure you know what you are doing. Always backup your data first.</para>
137 <para>It is <emphasis role="bold">*strongly*</emphasis> recommended to do
138 a "dry run" first and to check the output for conversion errors.</para>
140 <para><citerefentry><refentrytitle>afpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
141 should <emphasis>not</emphasis> be running while you change the volume
142 encoding. Remember to change <option>unix charset</option> or
143 <option>vol charset</option> in
144 <citerefentry><refentrytitle>afp.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
145 to the new codepage, before restarting afpd.</para>
147 <para>In case of <emphasis role="bold">MacChineseTraditional</emphasis>,
148 <emphasis role="bold">MacJapanese</emphasis> or
149 <emphasis role="bold">MacKorean</emphasis>,
150 uniconv cannot be used.</para>
152 <para><emphasis role="bold">USE AT YOUR OWN RISK!!!</emphasis></para>
156 <title>Selectable charsets</title>
158 <para>Netatalk provides internal support for UTF-8 (pre- and decomposed)
159 and HEX. If you want to use other charsets, they must be provided by
160 <citerefentry><refentrytitle>iconv</refentrytitle><manvolnum>1</manvolnum></citerefentry></para>
162 <para><command>uniconv</command> also knows iso-8859.adapted, an old style
163 1.x NLS widely used. This is only intended for upgrading old volumes,
164 <citerefentry><refentrytitle>afpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
165 cannot handle iso-8859.adapted anymore.</para>
169 <title>CNID background</title>
171 <para>The CNID backends maintains name to ID mappings. If you change a
172 filename outside afpd(8) (shell, samba), the CNID db, i.e. the DIDNAME
173 index, gets inconsistent. Netatalk tries to recover from such
174 inconsistencies as gracefully as possible. The mechanisms to resolve such
175 inconsistencies may fail sometimes, though, as this is not an easy task to
176 accomplish. I.e. if several names in the path to the file or directory
177 have changed, things may go wrong.</para>
179 <para>If you change a lot of filenames at once, chances are higher that
180 the afpds fallback mechanisms fail, i.e. files will be assigned new IDs,
181 even though the file hasn't changed. <command>uniconv</command>
182 therefore updates the CNID entry for each file/directory directly after it
183 changes the name to avoid inconsistencies. The two supported backends for
184 volumes, dbd and cdb, use the same CNID db format. Therefore, you
185 <emphasis>could</emphasis> use <command>uniconv</command> with cdb and
186 <command>afpd</command> with dbd later.</para>
188 <para><emphasis role="bold">Warning</emphasis>: There must not be two
189 processes opening the CNID database using different backends at once! If a
190 volume is still opened with dbd (cnid_metad/cnid_dbd) and you start
191 <command>uniconv</command> with cdb, the result will be a corrupted CNID
192 database, as the two backends use different locking schemes. You might run
193 into additional problems, e.g. if dbd is compiled with transactions, cdb
194 will not update the transaction logs.</para>
196 <para>In general, it is recommended to use the same backend for
197 <command>uniconv</command> you are using with
198 <citerefentry><refentrytitle>afpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
202 <title>Examples</title>
204 <para>convert 1.x CAP encoded volume to UTF-8, clients used MacRoman
205 codepage, cnidscheme is dbd:</para>
207 <screen><prompt>example%</prompt><userinput> uniconv -c dbd -f ASCII -t UTF8 -m MAC_ROMAN /path/to/share</userinput></screen>
209 <para>convert iso8859-1 volume to UTF-8, cnidscheme is cdb:</para>
211 <screen><prompt>example%</prompt><userinput> uniconv -c cdb -f ISO-8859-1 -t UTF8 -m MAC_ROMAN /path/to/share</userinput></screen>
213 <para>convert 1.x volume using iso8859-1 adapted NLS to HEX encoding:</para>
215 <screen><prompt>example%</prompt><userinput> uniconv -f ISO-8859-ADAPTED -t ASCII -m MAC_ROMAN/path/to/share</userinput></screen>
217 <para>convert UTF-8 volume to HEX, for MacCyrillic clients:</para>
219 <screen><prompt>example%</prompt><userinput> uniconv -f UTF8 -t ASCII -m MAC_CYRILLIC /path/to/share</userinput></screen>
223 <title>See also</title>
225 <para><citerefentry><refentrytitle>afp.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,<citerefentry><refentrytitle>afpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,<citerefentry><refentrytitle>iconv</refentrytitle><manvolnum>1</manvolnum></citerefentry>,<citerefentry><refentrytitle>cnid_metad</refentrytitle><manvolnum>8</manvolnum></citerefentry>,<citerefentry><refentrytitle>cnid_dbd</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>