Add all the source files from the old CVS tree,
[import/samba-docs-svnimport.git] / howto / NT4Migration.xml
1 <chapter id="NT4Migration">
2 <chapterinfo>
3         &author.jht;
4         <pubdate>April 3, 2003</pubdate>
5 </chapterinfo>
6
7 <title>Migration from NT4 PDC to Samba-3 PDC</title>
8
9 <para>
10 This is a rough guide to assist those wishing to migrate from NT4 Domain Control to
11 Samba-3-based Domain Control.
12 </para>
13
14 <sect1>
15 <title>Planning and Getting Started</title>
16
17 <para>
18 In the IT world there is often a saying that all problems are encountered because of
19 poor planning. The corollary to this saying is that not all problems can be anticipated
20 and planned for. Then again, good planning will anticipate most show-stopper-type situations.
21 </para>
22
23 <para>
24 Those wishing to migrate from MS Windows NT4 Domain Control to a Samba-3 Domain Control
25 environment would do well to develop a detailed migration plan. So here are a few pointers to
26 help migration get under way.
27 </para>
28
29 <sect2>
30 <title>Objectives</title>
31
32 <para>
33 The key objective for most organizations will be to make the migration from MS Windows NT4 
34 to Samba-3 Domain Control as painless as possible. One of the challenges you may experience
35 in your migration process may well be one of convincing management that the new environment
36 should remain in place. Many who have introduced open source technologies have experienced
37 pressure to return to a Microsoft-based platform solution at the first sign of trouble. 
38 </para>
39
40 <para>
41 Before attempting a migration to a Samba-3 controlled network, make every possible effort to
42 gain all-round commitment to the change. Know precisely <emphasis>why</emphasis> the change
43 is important for the organization. Possible motivations to make a change include:
44 </para>
45
46 <itemizedlist>
47     <listitem><para>Improve network manageability.</para></listitem>
48     <listitem><para>Obtain better user level functionality.</para></listitem>
49     <listitem><para>Reduce network operating costs.</para></listitem>
50     <listitem><para>Reduce exposure caused by Microsoft withdrawal of NT4 support.</para></listitem>
51     <listitem><para>Avoid MS License 6 implications.</para></listitem>
52     <listitem><para>Reduce organization's dependency on Microsoft.</para></listitem>
53 </itemizedlist>
54
55 <para>
56 Make sure everyone knows that Samba-3 is not MS Windows NT4. Samba-3 offers
57 an alternative solution that is both different from MS Windows NT4 and offers 
58 advantages compared with it. Gain recognition that Samba-3 lacks many of the
59 features that Microsoft has promoted as core values in migration from MS Windows NT4 to 
60 MS Windows 2000 and beyond (with or without Active Directory services).
61 </para>
62
63 <para>
64 What are the features that Samba-3 cannot provide?
65 </para>
66
67 <itemizedlist>
68         <listitem><para>Active Directory Server.</para></listitem>
69         <listitem><para>Group Policy Objects (in Active Directory).</para></listitem>
70         <listitem><para>Machine Policy Objects.</para></listitem>
71         <listitem><para>Logon Scripts in Active Directory.</para></listitem>
72         <listitem><para>Software Application and Access Controls in Active Directory.</para></listitem>
73 </itemizedlist>
74
75 <para>
76 The features that Samba-3 does provide and that may be of compelling interest to your site
77 include:
78 </para>
79
80 <itemizedlist>
81         <listitem><para>Lower cost of ownership.</para></listitem>
82         <listitem><para>Global availability of support with no strings attached.</para></listitem>
83         <listitem><para>Dynamic SMB Servers (can run more than one SMB/CIFS server per UNIX/Linux system).</para></listitem>
84         <listitem><para>Creation of on-the-fly logon scripts.</para></listitem>
85         <listitem><para>Creation of on-the-fly Policy Files.</para></listitem>
86         <listitem><para>Greater stability, reliability, performance and availability.</para></listitem>
87         <listitem><para>Manageability via an ssh connection.</para></listitem>
88         <listitem><para>Flexible choices of back-end authentication technologies (tdbsam, ldapsam, mysqlsam).</para></listitem>
89         <listitem><para>Ability to implement a full single-sign-on architecture.</para></listitem>
90         <listitem><para>Ability to distribute authentication systems for absolute minimum wide area network bandwidth demand.</para></listitem>
91 </itemizedlist>
92
93 <para>
94 Before migrating a network from MS Windows NT4 to Samba-3, consider all necessary factors. Users
95 should be educated about changes they may experience so the change will be a welcome one
96 and not become an obstacle to the work they need to do. The following are factors that will 
97 help ensure a successful migration:
98 </para>
99
100 <sect3>
101 <title>Domain Layout</title>
102
103 <para>
104 Samba-3 can be configured as a Domain Controller, a back-up Domain Controller (probably best called
105 a secondary controller), a Domain Member, or as a stand-alone Server. The Windows network security
106 domain context should be sized and scoped before implementation. Particular attention needs to be
107 paid to the location of the primary Domain Controller (PDC) as well as backup controllers (BDCs).
108 One way in which Samba-3 differs from Microsoft technology is that if one chooses to use an LDAP
109 authentication backend, then the same database can be used by several different domains. In a
110 complex organization, there can be a single LDAP database, which itself can be distributed (have
111 a master server and multiple slave servers) that can simultaneously serve multiple domains.
112 </para>
113
114 <para>
115 From a design perspective, the number of users per server as well as the number of servers per
116 domain should be scaled taking into consideration server capacity and network bandwidth.
117 </para>
118
119 <para>
120 A physical network segment may house several domains. Each may span multiple network segments.
121 Where domains span routed network segments, consider and test the performance implications of
122 the design and layout of a network. A centrally located Domain Controller that is designed to
123 serve multiple routed network segments may result in severe performance problems. Check the
124 response time (ping timing) between the remote segment and the PDC. If
125 it's long (more than 100 ms),
126 locate a backup controller (BDC) on the remote segment to serve as the local authentication and
127 access control server.
128 </para>
129 </sect3>
130
131 <sect3>
132 <title>Server Share and Directory Layout</title>
133
134 <para>
135 There are cardinal rules to effective network design that cannot be broken with impunity.
136 The most important rule: Simplicity is king in every well-controlled network. Every part of
137 the infrastructure must be managed; the more complex it is, the greater will be the demand
138 of keeping systems secure and functional.
139 </para>
140
141 <para>
142 Keep in mind the nature of how data must be shared. Physical disk space layout should be considered
143 carefully. Some data must be backed up. The simpler the disk layout the easier it will be to
144 keep track of backup needs. Identify what backup media will meet your needs; consider backup to tape,
145 CD-ROM or (DVD-ROM), or other offline storage medium. Plan and implement for minimum
146 maintenance. Leave nothing to chance in your design; above all, do not leave backups to chance:
147 Backup, test, and validate every backup, create a disaster recovery plan and prove that it works.
148 </para>
149
150 <para>
151 Users should be grouped according to data access control needs. File and directory access 
152 is best controlled via group permissions and the use of the <quote>sticky bit</quote> on group controlled
153 directories may substantially avoid file access complaints from Samba share users.
154 </para>
155
156 <para>
157 Inexperienced  network administrators often attempt elaborate techniques to set access
158 controls on files, directories, shares, as well as in share definitions.
159 Keep your design and implementation simple and document your design extensively. Have others
160 audit your documentation. Do not create a complex mess that your successor will not understand.
161 Remember, job security through complex design and implementation may cause loss of operations
162 and downtime to users as the new administrator learns to untangle your knots. Keep access
163 controls simple and effective and make sure that users will never be interrupted by obtuse
164 complexity.
165 </para>
166 </sect3>
167
168 <sect3>
169 <title>Logon Scripts</title>
170
171 <para>
172 Logon scripts can help to ensure that all users gain the share and printer connections they need.
173 </para>
174
175 <para>
176 Logon scripts can be created on-the-fly so all commands executed are specific to the
177 rights and privileges granted to the user. The preferred controls should be affected through
178 group membership so group information can be used to create a custom logon script using
179 the <smbconfoption><name>root preexec</name></smbconfoption> parameters to the <smbconfsection>NETLOGON</smbconfsection> share.
180 </para>
181
182 <para>
183 Some sites prefer to use a tool such as <command>kixstart</command> to establish a controlled
184 user environment. In any case, you may wish to do a Google search for logon script process controls.
185 In particular, you may wish to explore the use of the Microsoft Knowledge Base article KB189105 that
186 deals with how to add printers without user intervention via the logon script process.
187 </para>
188 </sect3>
189
190 <sect3>
191 <title>Profile Migration/Creation</title>
192
193 <para>
194 User and Group Profiles may be migrated using the tools described in the section titled Desktop Profile
195 Management.
196 </para>
197
198
199 <para>
200 <indexterm><primary>SID</primary></indexterm>
201 Profiles may also be managed using the Samba-3 tool <command>profiles</command>. This tool allows
202 the MS Windows NT-style security identifiers (SIDs) that are stored inside the profile <filename>NTuser.DAT</filename> file
203 to be changed to the SID of the Samba-3 domain.
204 </para>
205 </sect3>
206
207 <sect3>
208 <title>User and Group Accounts</title>
209
210 <para>
211 It is possible to migrate all account settings from an MS Windows NT4 domain to Samba-3. Before
212 attempting to migrate user and group accounts, it is STRONGLY advised to create in Samba-3 the
213 groups that are present on the MS Windows NT4 domain <emphasis>AND</emphasis> to map them to
214 suitable UNIX/Linux groups. By following this simple advice, all user and group attributes
215 should migrate painlessly.
216 </para>
217 </sect3>
218
219 </sect2>
220
221 <sect2>
222 <title>Steps in Migration Process</title>
223
224 <para>
225 The approximate migration process is described below.
226 </para>
227
228 <itemizedlist>
229 <listitem><para>
230 You have an NT4 PDC that has the users, groups, policies and profiles to be migrated.
231 </para></listitem>
232
233 <listitem><para>
234 Samba-3 set up as a DC with netlogon share, profile share, and so on. Configure the &smb.conf; file
235 to function as a BDC, i.e., <parameter>domain master = No</parameter>.
236 </para></listitem>
237 </itemizedlist>
238
239 <procedure><title>The Account Migration Process</title>
240         <step><para>
241 <indexterm><primary>pdbedit</primary></indexterm>
242                         Create a BDC account in the old NT4 domain for the Samba server using NT Server Manager.</para>
243                 <substeps><step><para>Samba must not be running.</para></step></substeps></step>
244
245
246         <step><para>
247 <indexterm><primary>net</primary><secondary>rpc</secondary></indexterm>
248                         <userinput>net rpc join -S <replaceable>NT4PDC</replaceable> -w <replaceable>DOMNAME</replaceable> -U Administrator%<replaceable>passwd</replaceable></userinput></para></step>
249
250         <step><para><userinput>net rpc vampire -S <replaceable>NT4PDC</replaceable> -U administrator%<replaceable>passwd</replaceable></userinput></para></step>
251
252         <step><para><userinput>pdbedit -L</userinput></para>
253                 <substeps><step><para>Note &smbmdash; did the users migrate?</para></step></substeps>
254         </step>
255
256
257         <step><para>
258 <indexterm><primary>net</primary><secondary>groupmap</secondary></indexterm>
259 <indexterm><primary>initGroups.sh</primary></indexterm>
260         Now assign each of the UNIX groups to NT groups:
261         (It may be useful to copy this text to a script called <filename>initGroups.sh</filename>)
262         <smbfile name="initGroups.sh">
263         <programlisting>
264 #!/bin/bash
265 #### Keep this as a shell script for future re-use
266                         
267 # First assign well known domain global groups
268 net groupmap modify ntgroup="Domain Admins" unixgroup=root   rid=512
269 net groupmap modify ntgroup="Domain Users"  unixgroup=users  rid=513
270 net groupmap modify ntgroup="Domain Guests" unixgroup=nobody rid=514
271
272 # Now for our added domain global groups
273 net groupmap add ntgroup="Designers" unixgroup=designers type=d rid=3200
274 net groupmap add ntgroup="Engineers" unixgroup=engineers type=d rid=3210
275 net groupmap add ntgroup="QA Team"   unixgroup=qateam    type=d rid=3220
276 </programlisting>
277 </smbfile>
278         </para></step>
279
280         <step><para><userinput>net groupmap list</userinput></para>
281                 <substeps><step><para>Check that all groups are recognized.</para></step></substeps>
282         </step>
283 </procedure>
284
285 <para>
286 Migrate all the profiles, then migrate all policy files.
287 </para>
288
289 </sect2>
290 </sect1>
291
292 <sect1>
293 <title>Migration Options</title>
294
295 <para>
296 Sites that wish to migrate from MS Windows NT4 Domain Control to a Samba-based solution
297 generally fit into three basic categories. <link linkend="majtypes">Following table</link> shows the possibilities.
298 </para>
299
300 <table frame="all" id="majtypes"><title>The Three Major Site Types</title>
301 <tgroup cols="2">
302         <colspec align="left"/>
303         <colspec align="justify" colspec="1*"/>
304         <thead>
305         <row><entry>Number of Users</entry><entry>Description</entry></row>
306         </thead>
307         <tbody>
308         <row><entry>&lt; 50</entry><entry><para>Want simple conversion with no pain.</para></entry></row>
309         <row><entry>50 - 250</entry><entry><para>Want new features, can manage some in-house complexity.</para></entry></row>
310         <row><entry>&gt; 250</entry><entry><para>Solution/Implementation must scale well, complex needs. Cross-departmental decision process. Local expertise in most areas.</para></entry></row>
311         </tbody>
312 </tgroup>
313 </table>
314
315 <sect2>
316 <title>Planning for Success</title>
317
318 <para>
319 There are three basic choices for sites that intend to migrate from MS Windows NT4
320 to Samba-3:
321 </para>
322
323 <itemizedlist>
324         <listitem><para>
325         Simple conversion (total replacement).
326         </para></listitem>
327
328         <listitem><para>
329         Upgraded conversion (could be one of integration).
330         </para></listitem>
331
332         <listitem><para>
333         Complete redesign (completely new solution).
334         </para></listitem>
335 </itemizedlist>
336
337 <para>
338 Minimize down-stream problems by:
339 </para>
340
341 <itemizedlist>
342         <listitem><para>
343         Taking sufficient time.
344         </para></listitem>
345
346         <listitem><para>
347         Avoiding Panic.
348         </para></listitem>
349
350         <listitem><para>
351         Testing all assumptions.
352         </para></listitem>
353
354         <listitem><para>
355         Testing the full roll-out program, including workstation deployment.
356         </para></listitem>
357 </itemizedlist>
358
359 <para><link linkend="natconchoices">Following table</link> lists the conversion choices given the type of migration
360 being contemplated.
361 </para>
362
363 <table frame="all" id="natconchoices"><title>Nature of the Conversion Choices</title>
364 <tgroup cols="3">
365         <colspec align="justify" colwidth="1*"/>
366         <colspec align="justify" colwidth="1*"/>
367         <colspec align="justify" colwidth="1*"/>
368         <thead>
369         <row><entry>Simple</entry><entry>Upgraded</entry><entry>Redesign</entry></row>
370         </thead>
371         <tbody>
372         <row>
373         <entry><para>Make use of minimal OS specific features.</para></entry>
374         <entry><para>Translate NT4 features to new host OS features.</para></entry>
375         <entry><para>Decide:</para></entry>
376         </row>
377         <row>
378         <entry><para>Move all accounts from NT4 into Samba-3</para></entry>
379         <entry><para>Copy and improve</para></entry>
380         <entry><para>Authentication regime (database location and access)</para></entry>
381         </row>
382         <row>
383         <entry><para>Make least number of operational changes</para></entry>
384         <entry><para>Make progressive improvements</para></entry>
385         <entry><para>Desktop management methods</para></entry>
386         </row>
387         <row>
388         <entry><para>Take least amount of time to migrate</para></entry>
389         <entry><para>Minimize user impact</para></entry>
390         <entry><para>Better control of Desktops/Users</para></entry>
391         </row>
392         <row>
393         <entry><para>Live versus isolated conversion</para></entry>
394         <entry><para>Maximize functionality</para></entry>
395         <entry><para>Identify Needs for: <emphasis>Manageability, Scalability, Security, Availability</emphasis></para></entry>
396         </row>
397         <row>
398         <entry><para>Integrate Samba-3 then migrate while users are active, then change of control (swap out)</para></entry>
399         <entry><para>Take advantage of lower maintenance opportunity</para></entry>
400         <entry><para></para></entry>
401         </row>
402         </tbody>
403 </tgroup>
404 </table>
405 </sect2>
406
407 <sect2>
408 <title>Samba-3 Implementation Choices</title>
409
410 <variablelist>
411         <varlistentry><term>Authentication Database/Backend</term><listitem>
412                 <para>
413                 Samba-3 can use an external authentication backend:
414                 </para>
415
416                 <para>
417                 <itemizedlist>
418                         <listitem><para>Winbind (external Samba or NT4/200x server).</para></listitem>
419                         <listitem><para>External server could use Active Directory or NT4 Domain.</para></listitem>
420                         <listitem><para>Can use pam_mkhomedir.so to auto-create home dirs.</para></listitem>
421                         <listitem><para>
422                                         Samba-3 can use a local authentication backend: <parameter>smbpasswd, tdbsam, ldapsam, mysqlsam</parameter></para></listitem>
423         </itemizedlist>
424                 </para>
425         </listitem></varlistentry>
426
427         <varlistentry><term>Access Control Points</term><listitem>
428                 <para>
429                 Samba permits Access Control Points to be set:
430                 </para>
431                 <itemizedlist>
432                         <listitem><para>On the share itself &smbmdash; using Share ACLs.</para></listitem>
433                         <listitem><para>On the file system &smbmdash; using UNIX permissions on files and directories.</para>
434                                 <para>Note: Can enable Posix ACLs in file system also.</para></listitem>
435                         <listitem><para>Through Samba share parameters &smbmdash; not recommended except as last resort.</para></listitem>
436                 </itemizedlist>
437                 </listitem>
438         </varlistentry>
439
440         <varlistentry><term>Policies (migrate or create new ones)</term><listitem>
441                 <para>
442                 Exercise great caution when affecting registry changes, use the right tool and be aware
443                 that changes made through NT4-style <filename>NTConfig.POL</filename> files can leave
444                 permanent changes.
445                 </para>
446                 <itemizedlist>
447                         <listitem><para>Using Group Policy Editor (NT4).</para></listitem>
448                         <listitem><para>Watch out for Tattoo effect.</para></listitem>
449                 </itemizedlist>
450                 </listitem>
451         </varlistentry>
452
453         <varlistentry><term>User and Group Profiles</term><listitem>
454                 <para>
455                 Platform-specific so use platform tool to change from a Local to a Roaming profile.
456                 Can use new profiles tool to change SIDs (<filename>NTUser.DAT</filename>).
457                 </para>
458                 </listitem>
459         </varlistentry>
460
461         <varlistentry><term>Logon Scripts</term><listitem>
462                 <para>
463                 Know how they work.
464                 </para>
465                 </listitem>
466         </varlistentry>
467
468
469         <varlistentry><term>User and Group Mapping to UNIX/Linux</term><listitem>
470                 <para>
471 <indexterm><primary>pdbedit</primary></indexterm>
472                 User and Group mapping code is new. Many problems have been experienced as network administrators
473                 who are familiar with Samba-2.2.x migrate to Samba-3. Carefully study the chapters that document
474                 the new password backend behavior and the new group mapping functionality.
475                 </para>
476                 <itemizedlist>
477                         <listitem><para>The <parameter>username map</parameter> facility may be needed.</para></listitem>
478                         <listitem><para>Use <command>net groupmap</command> to connect NT4 groups to UNIX groups.</para></listitem>
479                         <listitem><para>Use <command>pdbedit</command> to set/change user configuration.</para>
480
481                                 <para>
482                                 When migrating to LDAP backend, it may be easier to dump the initial
483                                 LDAP database to LDIF, edit, then reload into LDAP.
484                                 </para>
485                         </listitem>
486                 </itemizedlist>
487                 </listitem>
488         </varlistentry>
489
490         <varlistentry><term>OS Specific Scripts/Programs may be Needed</term><listitem>
491                 <para>
492                 Every operating system has its peculiarities. These are the result of engineering decisions
493                 that were based on the experience of the designer, and may have side-effects that were not
494                 anticipated. Limitations that may bite the Windows network administrator include:
495                 </para>
496                 <itemizedlist>
497                         <listitem><para>Add/Delete Users: Note OS limits on size of name
498                                 (Linux 8 chars) NT4 up to 254 chars.</para></listitem>
499                         <listitem><para>Add/Delete Machines: Applied only to Domain Members
500                                 (Note: machine names may be limited to 16 characters).</para></listitem>
501                         <listitem><para>Use <command>net groupmap</command> to connect NT4 groups to UNIX groups.</para></listitem>
502                         <listitem><para>Add/Delete Groups: Note OS limits on size and nature.
503                                 Linux limit is 16 char, no spaces and no upper case chars (<command>groupadd</command>).</para></listitem>
504                 </itemizedlist>
505                 </listitem>
506         </varlistentry>
507
508         <varlistentry><term>Migration Tools</term><listitem>
509                 <para>
510 <indexterm><primary>pdbedit</primary></indexterm>
511                 Domain Control (NT4 Style) Profiles, Policies, Access Controls, Security
512                 <itemizedlist>
513                         <listitem><para>Samba: <command>net, rpcclient, smbpasswd, pdbedit, profiles.</command></para></listitem>
514                         <listitem><para>Windows: <command>NT4 Domain User Manager, Server Manager (NEXUS)</command></para></listitem>
515                 </itemizedlist>
516                         </para>
517                 </listitem>
518         </varlistentry>
519 </variablelist>
520
521 </sect2>
522
523 </sect1>
524
525 </chapter>