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

.. |date| date::

.. meta::
  :description: Upgrading a Samba domain controller from Debian9 Stretch to Debian10 Buster
  :keywords: upgrade, Debian, Stretch, Buster, documentation

.. _server_upgrade_debian:

###########################################################################
Upgrading a Samba domain controller from Debian9 Stretch to Debian10 Buster
###########################################################################

* Install Debian10 (physical or virtual machine) in a **minimal** way without GUI and **only with SSH service**, following this `documentation <https://www.howtoforge.com/tutorial/debian-minimal-server/>`_.

.. attention::

  If you encounter a problem when updating the repository and if you get the errors ``gpg: no valid OpenPGP data found`` or ``wget: unable to resolve host address "mydomain.lan"``, you will need to check your :file:`/etc/resolv.conf` file and then add the following lines at the end of :file:`/root/.bashrc`:

  .. code-block:: bash

    export http_proxy="http://proxy:3128";
    export https_proxy="http://proxy:3128";

* Update the TIS Samba repositories:

  .. code-block:: bash

    wget -O - http://samba.tranquil.it/tissamba-pubkey.gpg  | apt-key add
    echo "deb http://samba.tranquil.it/debian/samba-4.11 buster main" > /etc/apt/sources.list.d/tissamba.list

* Check the Debian source file :file:`/etc/apt/sources.list`:

  .. code-block:: bash

    deb http://ftp.fr.debian.org/debian/ buster main contrib non-free
    deb-src http://ftp.fr.debian.org/debian/ buster main contrib non-free

    deb http://security.debian.org/debian-security buster/updates main contrib non-free
    deb-src http://security.debian.org/debian-security buster/updates main contrib non-free

    deb http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free
    deb-src http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free

* Check :file:`/etc/apt/sources.list.d/` then select *tissamba.list* and change the version of Samba if necessary:

  .. code-block:: bash

    deb http://mydomain.lan/debian/samba-4.11 buster main

* Update the host:

  .. code-block:: bash

    apt-get update
    apt-get upgrade
    apt-get dist-upgrade

* Restart the host:

  .. code-block:: bash

    reboot

* Check the version of the Samba server:

  .. code-block:: bash

    samba-tool --version