.. Reminder for header structure:        
  Parts (H1)          : #################### with overline
  Chapters (H2)       : ******************** with overline
  Sections (H3)       : ====================
  Subsections (H4)    : --------------------
  Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^
  Paragraphs (H6)     : """""""""""""""""""""

.. |date| date::


.. meta::
  :description: Transferring your Samba3-NT4 to a new host
  :keywords: Documentation, Samba3-NT4,

.. _samba_move_NT4_to_another_host:

##########################################
Transferring your Samba3-NT4 to a new host
##########################################

The following operations are performed with the *root* account.

* Stop the samba service with :command:`systemctl stop smb`.

* Dump the contents of your directory with :command:`slapcat > ldap_dump.ldif`.

* Recover the files :file:`/etc/slapd/`, :file:`/etc/samba/`, :file:`/etc/libnss*` and :file:`/var/lib/samba/`.

* Install the new machine with a basic Debian Buster 64bit by :ref:`following this documentation <install_base_debian>`.

* Install the following packages on the new machine:

  .. code-block:: bash

    apt-get install slapd samba libnss-ldap

* On the new host, copy back the four previously saved files.

* Reintegrate the LDAP database:

  .. code-block:: bash

    systemctl stop slapd
    rm -Rf /var/lib/ldap/*
    slapadd -f /root/ldap_dump.ldif
    chown -R openldap:openldap /var/lib/ldap
