Bug 9723 - Add a tool to migrate latin1 printing tdb's to registry
Summary: Add a tool to migrate latin1 printing tdb's to registry
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Printing (show other bugs)
Version: 3.6.12
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-15 13:10 UTC by Andreas Schneider
Modified: 2013-06-05 13:09 UTC (History)
2 users (show)

See Also:


Attachments
v4-0-test patch (33.17 KB, patch)
2013-03-15 13:13 UTC, Andreas Schneider
gd: review+
asn: review? (ddiss)
Details
v3-6-test patch (33.14 KB, patch)
2013-03-15 13:39 UTC, Andreas Schneider
gd: review+
asn: review? (ddiss)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2013-03-15 13:10:54 UTC
In 3.6 and 4.0 we miss a tool to migrate printing tdb's which are in latin1. The patchset extends the 'net printing' commands with an 'encoding=' option to define a codepage to convert from.
Comment 1 Andreas Schneider 2013-03-15 13:13:54 UTC
Created attachment 8649 [details]
v4-0-test patch
Comment 2 Andreas Schneider 2013-03-15 13:39:54 UTC
Created attachment 8650 [details]
v3-6-test patch
Comment 3 Andreas Schneider 2013-03-15 13:48:46 UTC
Text for WHATSNEW.txt:


It is still the case that there are printing tdbs (ntpringint.tdb, ntforms.tdb,
ntdrivers.tdb) which are in latin1 or other encodings. When updating from
Samba 3.5 or earlier to Samba 3.6 or 4.0 these tdbs need to be migrated to our
new registry based printing management.  This means during the migration we also
need to do charset conversion. This can only been done manually cause we don't know in which encoding the tdb is. You have to specify the correct code page for the conversion, see iconv -l and Wikipedia [1] for the available codepages. The mostly used one is Windows Latin1 which is CP1252.

We've extended the 'net printing dump' and 'net printing migrate' commands to
define the encoding of the tdb. So you can correctly view the tdb with:

  net printing dump encoding=CP1252 /path/to/ntprinters.tdb

or migrate it with e.g.:

  net printing migrate encoding=CP1252 /path/to/ntprinters.tdb

If you migrate printers we suggest you do it in the following order.

ntforms.tdb
ntdrivers.tdb
ntprinting.tdb

Don't forget to rename, move or delete these files in /var/lib/samba after the migration.

[1] https://en.wikipedia.org/wiki/Code_page
Comment 4 Andreas Schneider 2013-03-18 11:17:57 UTC
Karolin, please add to v3-6-test and v4-0-test test. Could you do me a favor and run:

  make test TESTS="local.ndr"

in the 3.6 branch. Just to be sure it works on a different machine too.
Comment 5 Karolin Seeger 2013-03-21 08:48:20 UTC
Pushed to autobuild-v4-0-test.
Comment 6 Karolin Seeger 2013-03-21 09:15:46 UTC
Pushed to v3-6-test after running 'make test'.
Comment 7 Karolin Seeger 2013-03-21 10:53:18 UTC
Pushed to v4-0-test.
Leaving bug report open to add the section for the release notes.
Comment 8 Karolin Seeger 2013-04-09 06:58:15 UTC
Closing out bug report.

Thanks!
Comment 9 Björn Jacke 2013-05-03 09:12:50 UTC
I think we should also write in the text, which encoding is being used now, I guess some Unicode charset? UTF-8? UTF-16?

Also the text should contain some information what determined the charset that was previously used.

Andreas, can you tell somthing about this points?
Comment 10 Andreas Schneider 2013-05-06 06:47:32 UTC
> I think we should also write in the text, which encoding is being used now, I
> guess some Unicode charset? UTF-8? UTF-16?

man smb.conf -> unix charset

> Also the text should contain some information what determined the charset that
> was previously used.

Nothing. We expect that the tdb's are in UTF-8.
Comment 11 Andreas Schneider 2013-05-29 05:42:57 UTC
Björn, what do you want documented where?
Comment 12 Björn Jacke 2013-06-05 13:09:32 UTC
let's leave it like this, i don't know how ot improve it becuase i don't really understand how exactly the tdb encoding was handled in the past with which versions of samba. in any case with the dump and migrate options people should be able to figure out what to do somehow.