Chapter 8. Migrating NT4 Domain to Samba-3

Table of Contents

Introduction
Assignment Tasks
Dissection and Discussion
Technical Issues
Political Issues
Implementation
NT4 Migration Using LDAP Backend
NT4 Migration Using tdbsam Backend
Key Points Learned
Questions and Answers

Ever since Microsoft announced that they are discontinuing support for Windows NT4, Samba users started to ask for detailed instructions for how to migrate from NT4 to Samba-3. This chapter provides background information that should meet these needs.

One wonders how many NT4 systems will be left in service by the time you read this book though.

Introduction

Network administrators who want to migrate off a Windows NT4 environment know one thing with certainty. They feel that NT4 has been abandoned and they want to update. The desire to get off NT4 and to not adopt Windows 200x and Active Directory is driven by a mixture of concerns over complexity, cost, fear of failure, and much more.

The migration from NT4 to Samba-3 can involve a number of factors, including: migration of data to another server, migration of network environment controls such as group policies, and finally migration of the users, groups, and machine accounts.

It should be pointed out now that it is possible to migrate some systems from Windows NT4 Domain environments to a Samba-3 Domain Environment. This is certainly not possible in every case. It is possible to just migrate the Domain accounts to Samba-3 and then to switch machines, but as a hands-off transition, this is more an exception than the rule. Most systems require some tweaking and adjusting following migration before an environment that is acceptable for immediate use is obtained.

Assignment Tasks

You are about to migrate an MS Windows NT4 Domain accounts database to a Samba-3 server. The Samba-3 server is using a passdb backend based on LDAP. The ldapsam is ideal because an LDAP backend can be distributed for use with BDCs generally essential for larger networks.

Your objective is to document the process of migrating user and group accounts from several NT4 Domains into a single Samba-3 LDAP backend database.

Dissection and Discussion

The migration process takes a snap-shot of information that is stored in the Windows NT4 registry based accounts database. That information resides in the Security Account Manager (SAM) portion of the NT4 Registry under keys called SAM and SECURITY.

Warning

The Windows NT4 registry keys called SAM and SECURITY are protected so that you cannot view the contents. If you change the security setting to reveal the contents under these hive keys, your Windows NT4 Domain is crippled. Do not do this unless you are willing to render your domain controller inoperative.

Before commencing an NT4 to Samba-3 migration, you should consider what your objectives are. While in some cases it is possible simply to migrate an NT4 domain to a single Samba-3 server, that may not be a good idea from an administration perspective. Since you are going through a certain amount of disruptive activity anyhow, why not take this as an opportunity to review the structure of the network, how Windows clients are controlled and how they interact with the network environment.

MS Windows NT4 was introduced some time around 1996. Many environments in which NT4 was deployed have done little to keep the NT4 server environment up-to-date with more recent Windows releases, particularly Windows XP Professional. The migration provides opportunity to revise and update roaming profile deployment as well as folder redirection. Given that you must port the greater network configuration of this from the old NT4 server to the new Samba-3 server, you also must validate the security descriptors in the profiles share as well as network logon scripts. Feedback from sites that are migrating to Samba-3 suggests that many are using this as a good time to update desktop systems also. In all, the extra effort should constitute no real disruption to users, rather with due diligence and care should make their network experience a much happier one.

Technical Issues

Migration of an NT4 Domain user and group database to Samba-3 involves a certain strategic element. Many sites have asked for instructions regarding merging of multiple different NT4 Domains into one Samba-3 LDAP database. It would appear that this is viewed as a significant added value compared with the alternative of migration to Windows Server 200x and Active Directory. The diagram in ??? illustrates the effect of migration from a Windows NT4 Domain to a Samba Domain.

Figure 8.1. Schematic Explaining the net rpc vampire Process

Schematic Explaining the net rpc vampire Process

In any case, the migration process involves the following steps:

  • Prepare the target Samba-3 server. This involves configuring Samba-3 for migration to either a tdbsam or an ldapsam backend.

  • Clean up the source NT4 PDC. Delete all accounts that need not be migrated. Delete all files that should not be migrated. Where possible, change NT Group names so there are no spaces or uppercase characters. This is important if the target UNIX host insists on Posix compliant all lower-case user and group names.

  • Step through the migration process.

  • Remove the NT4 PDC from the network.

  • Upgrade the Samba-3 server from a BDC to a PDC, and validate all account information.

If you are wanting to merge multiple NT4 Domain account databases into one Samba Domain, you must now dump the contents of the first migration and edit it as appropriate. Now clean out (remove) the tdbsam backend file (passdb.tdb), or the LDAP database files. You must start each migration with a new database into which you merge your NT4 domains.

At this point, you are ready to perform the second migration following the same steps as for the first. In other words, dump the database, edit it, and then you may merge the dump for the first and second migrations.

You must be careful. If you choose to migrate to an LDAP backend, your dump file now contains the full account information, including the Domain SID. The Domain SID for each of the two NT4 Domains will be different. You must choose one, and change the Domain portion of the account SIDs so that all are the same.

If you choose to use a tdbsam (passdb.tdb) backend file, your best choice is to use pdbedit to export the contents of the tdbsam file into an smbpasswd data file. This automatically strips out all Domain specific information, such as logon hours, logon machines, logon script, profile path, as well as the Domain SID. The resulting file can be easily merged with other migration attempts (each of which must start with a clean file). It should also be noted that all users that end up in the merged smbpasswd file must have an account in /etc/passwd. The resulting smbpasswd file may be exported/imported into either a tdbsam (passdb.tdb), or else into an LDAP backend.

Figure 8.2. View of Accounts in NT4 Domain User Manager

View of Accounts in NT4 Domain User Manager

Political Issues

The merging of multiple Windows NT4 style Domains into a single LDAP-backend-based Samba-3 Domain may be seen by those who had power over them as a loss of prestige or a loss of power. The imposition of a single Domain may even be seen as a threat. So in migrating and merging account databases, be consciously aware of the political fall-out in which you may find yourself entangled when key staff feel a loss of prestige.

The best advice that can be given to those who set out to merge NT4 Domains into one single Samba-3 Domain is to promote (sell) the action as one that reduces costs and delivers greater network interoperability and manageability.

Implementation

You can present here the steps and example output for two NT4 to Samba-3 Domain migrations. The first uses an LDAP-based backend, and the second uses a tdbsam backend. In each case the scripts you specify in the smb.conf file for the add user script collection of parameters are used to effect the addition of accounts into the passdb backend.

NT4 Migration Using LDAP Backend

In this instance, you migrate an NT4 PDC to an LDAP backend. The accounts you are about to migrate are shown in ???. In this example you make use of the smbldap-tools scripts to add the accounts that are migrated into the ldapsam passdb backend. Four scripts are essential to the migration process. There are other scripts that will be required for daily management, but these are not critical to migration. The critical scripts are dependant on which passdb backend is being used. Refer to ??? to see which scripts must be provided so that the migration process can complete.

Do verify that you have correctly specified in the smb.conf file the scripts, and arguments that should be passed to them, before attempting to perform the account migration.

Table 8.1. Samba smb.conf Scripts Essential to Migration

Entityldapsam Scripttdbsam Script
Add User Accountssmbldap-useradd.pluseradd
Delete User Accountssmbldap-userdel.pluserdel
Add Group Accountssmbldap-groupadd.plgroupadd
Delete Group Accountssmbldap-groupdel.plgroupdel
Add User to Groupsmbldap-groupmod.plusermod (See Note)
Add Machine Accountssmbldap-useradd.pluseradd

Note

The UNIX/Linux usermod utility does not permit simple user addition to (or deletion of users from) groups. This is a feature provided by the smbldap-tools scripts. If you want this capability you will need to create your own tool to do this. Alternately, you can search the web to locate a utility called groupmem (by George Kraft) that provides this functionality. The groupmem utility was contributed to the shadow package but has not surfacedorin the formal commands provided by Linux distributions (March 2004).

Before starting the migration, all dead accounts were removed using the User Manager for Domains.

Note

The tdbdump utility is a utility that you can build from the Samba source code tree. Not all Linux binary distributions include this tool. If it is missing from your Linux distribution you will need to build this yourself, or else for-go its use.

  1. Install and configure the Samba-3 server precisely as shown in Chapter 6 for the server called MASSIVE. The Domain name MEGANET must match that of the NT4 Domain from which you are about to migrate. Do not execute any Samba executables.

  2. Edit the smb.conf file to temporarily change the parameter domain master = No so the Samba server functions as a BDC for the purpose of migration.

  3. Create a file called preload.LDIF as shown in ???.

  4. Preload the LDAP database so it is ready to receive the information from the NT4 PDC. This pre-loads the LDAP directory with the top-level information, as well as the top level containers for user, group, computer, and domain account data. Execute the instruction shown here:

    root#  slapadd -v -l preload.LDIF
    added: "dc=abmas,dc=biz" (00000001)
    added: "cn=Manager,dc=abmas,dc=biz" (00000002)
    added: "ou=People,dc=abmas,dc=biz" (00000003)
    added: "ou=Computers,dc=abmas,dc=biz" (00000004)
    added: "ou=Groups,dc=abmas,dc=biz" (00000005)
    added: "ou=Idmap,dc=abmas,dc=biz" (00000006)
    added: "ou=Domains,dc=abmas,dc=biz" (00000007)
    

  5. Start the LDAP server.

  6. Verify that the NT4 PDC can be reached:

    root#  ping nt4s
    PING nt4s.abmas.biz (192.168.2.250) 56(84) bytes of data.
    64 bytes from NT4S (192.168.2.250): icmp_seq=1 ttl=128 time=10.2 ms
    64 bytes from NT4S (192.168.2.250): icmp_seq=2 ttl=128 time=0.518 ms
    64 bytes from NT4S (192.168.2.250): icmp_seq=3 ttl=128 time=0.578 ms
    
    --- nt4s.abmas.biz ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2003ms
    rtt min/avg/max/mdev = 0.518mba smb.camba-3 DDusers,dc=A4.560abmap>
  7. Ve73ation of aVcurity des can bereee. Nosory. Sim reached:

    <="dilass="screen"> root# ping nt4s PINGfils. It i-Lz pin -UAwho want to %y S24get

  8. < PDCy dIPC

  9. < the looksupdatii>

    Ve76s="indexterm" name="id2551594"> Ed774is point, you are ready for then mixed-modefet locate each of C. This pre-l accounamba PDC canoerver preciserpos(sotion p> root# ping nt4s PINGe Procesgetsid.LS.2.250-W/ust m Sto r ofS-1-5-21-1988699175-926296742-1295 tri88up, c

  10. <<<<<<<<<<<<<<
  11. Ve81s="indexterm" name="id2551179">smb.conf ftassts elstemporaril,a href="mi class="screen"> root# slapadd -v -l pan> ut t>. Te="te/ tassts els { a l= "SECRETS/ o/The Dom" s aut= "\01\04\00\00\00\00\00\05\15\00\00\00'$\89v\A6*67\A0J9M\ 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\ 00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00" } { a l= "SECRETS/
  12. < the edorsstu> Ve88 Samba-3 iseperform the seWindo from which youhe purposbfollowinanager fsame stepss="screen"> root# ping nt4s PINGe ProcesWindoLS.2.250-W/ust m -U Awho want to %y S24get Joer whderver. st m. p>
  13. Ve9 Samba-3 hoTver preciserposof onwive the information frs pre-l ase. That informa,a href="mi class="screen"> root# slapadd -v -l e Process">. : , but: Ve96s="indexterm" name="id2551132">smb.conf file to temporarily chereet on tha class="indexterm" name="id2551609">domai9ss="inde= No so the SaYeare the server functions as a BDC for the puPpose of migration.

  14. < Table 8.1. SamDAP Preload LDIF file preload.LDIF">ename">preload.LDIF as shown in < summary=een">

  15. v class="sect2" lang="en">

    Poliation ion Using LDAP Backend>

    In this instance, you ass="paractly speciut tion ain portion of ="conain from whBDC to a PDonstant">SAM and MEGANET must match tprioamba-3 seed. ain fros">usermod/tbodity is a )counts that are migrated into the ldapsam passdb an>/etc/passwd. The resultin,="constant">SECU/passwd. T really consciousame smb.conf file to temporarily its useprocess can co My Samba sthe issed to ass="procedure">

    MEGANET must match ass

    V210s="indexterm" name="id2551171">smb.conf file to temporarily change the parameter doma2127aster = No so the Samba server functions as a BDC for the purpose of migration.

  16. V214must be caJindo from which youhe purpo,a href="mi class="screen"> root# slapadd -v -l e ProcesWindoLS.oldnt4pdc0-W/ust m -UAwho want to %y S24get Joer whderver. st m. p>

  17. V2183ust be carefulayos"><,a href="mi class="screen"> root# slapadd -v -l e Process">er, an: '. 'ocalletabaml">er, an: 'er, an: 'er, an: ', but'ocalletabaml">er, an: 'M.cks oidt'ocalletabases, be: Awho want to ocalletabases, be: Gnsweocalletabases, be: oldnt4pdc$ocalletabases, be: jan>oocalletabases, be: 00rykocalletabases, be: bridgeocalletabases, be: as ne , but: Awho want to ,

  18. <o(prib.co),

  19. <<00ryk(prib.co),jimbo,blue(prib.co),dtor(prib.co)ocalletabaml">er, an: 'Gn met' Fet lanagBUILTINles. You mSAM_DELTA_DOMAIN_INFOet the nd="cocalletabaml">er, an: 'r (SAM) Opt="Doct'ocalletabaml">er, an: 'Awho want to t'ocalletabaml">er, an: 'pan>d>er, an: 'Gnswes'ocalletabaml">er, an: 'PriM) Opt="Doct'ocalletabaml">er, an: 'Repl Domor'ocalletabaml">er, an: 'cs as aOpt="Doct'ocalletabaml">er, an: 'or Ds'op>
  20. V2238is point, you are ready wep: root# ping nt4s PING an> to -Lw Awho want to :505:84B0D8E14D158FF8417EAF50CFAC29C3:

    AF6DD3FD4E2EA8BDE1695A3F05EFBF52:[UXli>
  21. <<]:LCT-3DF7AA9F: jimbo:512:6E9A2A51F64A1BD5C187B8085FE1D9DF:

    CDF7E305E639966E489A0CEFB95EE5E0:[UXli>
  22. <<]:LCT-3E9362BC: as ne <:511:E4301A7CD8FDD1EC6BBF9BC19CDF8151:

    7ou=P55938831D5B948C95C1931534C5:[UXli>
  23. <<]:LCT-3E8B42C4: dhenwick:513:DCD8886141E3F892AAD3B435B51404EE:

    2DB364clas9CB938DD98C312EFDC2639:[UXli>
  24. <<]:LCT-3E939F41: bridge:510:3FE6873A43101B46417EAF50CFAC29C3:

    891741F481AF1hoB4CAA09A94016BD01:[UXli>
  25. <<]:LCT-3E8B4291: blue:515:256D41DP559BB3D2AAD3B435B51404EE:

    9CCADDA4F7D281DD0FAD321478C6F971:[UXli>
  26. <<]:LCT-3E939FDC: diamond$:517:6C8E7B64EDCDBC4218B6345447A4454B:

    3323AC63C666CFAACB60C13F65D54E9A:[S li>
  27. <<]:LCT-share/do: oldnt4pdc$:507:3E39430CDCABB5B09ED320D0448AE568:

    95DBAF885854A919C7C7E671060478B9:[S li>
  28. <<]:LCT-3DF7AA9F: Gnswe:506:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:

    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[DUXli>
  29. <]:LCT-3E93A008: billw:516:85380CA7C21B6EBE168C8150662AF1hB:

    5D7478efor93709937E55FB5FBA14C17:[UXli>
  30. <<]:LCT-3FED7CA1: dtor:514:78C70DDEC35A35B5AAD3B435B51404EE:

    0AD886E015AC595EC0AF40E6C9689E1A:[UXli>
  31. <<]:LCT-3E939F9A: jan>o:508:BC472F3BF9A0A5F63832C92FC614B7D1:

    0C6822AAF85E8I trA40DC73E40D06D5:[UXli>
  32. <<]:LCT-3E8B4242: 00ryk:509:3636AB7E12EBE79AB79AE2610DD89D4C:

    CF271B744F7A55AFDA277FF88D80C527:[UXli>
  33. <<]:LCT-3E8B4270:op>
  34. V229ould be pcA Pmucathe Wvs in NTa to (or (SAM) ehe yref="eption startuireirst.>

    eto (6"><:i>
  35. <<00ryk NTeto (6"><:i>
  36. <<<<00ryk r (SAM) Flags:i>
  37. <<[UXli>
  38. <<] or DoSID:p>
  39. <<:i>
  40. <<<
  41. <\\diamond\00ryk td wriv Dture:i>
  42. <
  43. <<
  44. <<<\\diamond\ as well\00ryk <:

  45. <
  46. Peannouaker Wtorsiv>M the18 J Wloss,2 Apive 3 13:05:04 GMT Pay bord

    meter:
  47. <, but M.cks oidt>
  48. <
  49. <
  50. <
  51. <
  52. MHas tby
  53. V236s="indexterm" name="id2551594"> E2374the smb.conf file to temporarily chereet on tha class="indexterm" name="id2551609">doma2389="inde= No so the SaYeare erver functions as a BDC for the puPpose of migration.

  54. Polias Leainderned>

    The merging ofn NT4 Domain user anPposmba-3 involvar precisePposof ge NT Gr.ass="itemizedlist">

  55. V2326uld be pcA f, or eod<<="diectorylot4s.are nain fros a feated i spec andl Ncither a (s"> root# slapadd -v -l e Pr to Sa-l -Uapad%y S24get -S000sati o<="connnnnnaaaaaaCT4 tot ----------------------------- , butp>