How to full backup Ubuntu Server 16.04

To create full backup of the Ubuntu Server to the your local machine you  will need to create local, for example, VM Ware virtual machine with same version of the Ubuntu Server.
In my case, it will be Ubuntu Server 16.04.
1) To realize this tutorial, your server must be installed with Partitioning method – Use entire disk option. Attention – this tutorial not for Partitioning method – Use entire disk option and set up LVM!




2) Install Ubuntu Server 16.04 with default at your local VM Ware virtual machine:




Your partitioning on server must be equal to partitioning of the local machine!


3) Log in to remote server as root user.
4) Create at the server key pair without password:
 ssh-keygen
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
5) Allow remote root login on the server:
mcedit /etc/ssh/sshd_config
Comment 
PermitRootLogin prohibit-password
And paste 
PermitRootLogin yes
Result must be
#PermitRootLogin prohibit-password
PermitRootLogin yes
6) Restart sshd on remote server:
service sshd restart
7) After that, log in your local fresh machine as root
8) Run on local machine 
 ssh-keygen
to create on local machine key pair without password.
9) Run on local machine
 ssh-copy-id [email protected]
to copy keys from server to local machine:
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '46.29.161.220 (46.29.161.220)' can't be established.
ECDSA key fingerprint is SHA256:Lv2gh4mhu/r0TKCRNPoMtYZ+3cn2If8YGngN2OgO7i4.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

10) On the remote server disable root login:
mcedit /etc/ssh/sshd_config
 
PermitRootLogin prohibit-password
#PermitRootLogin yes
service sshd restart
11) On the local machine run 
rsync --delete -aAXzv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} [email protected]:/ /
To sync local machine with remote server. All unneeded for sync changes from local will be deleted and replaced with settings from server.
12) Don’t reboot local machine! Now you need to roll-back some changes in files, your received from server.
Run on local machine 
blkid
it will get you two UIID – for main file system partition and for swap partition:
/dev/sda1: UUID="5c964f3d-e020-4441-a816-72c203214689" TYPE="ext4" PARTUUID="994544bc-01"
/dev/sda5: UUID="5aadaaf9-2972-45a6-8286-8ad824fe2034" TYPE="swap" PARTUUID="994544bc-05"
You need to write UIIDs from blkid to files.
13) Run 
cat /etc/fstab
on local machine to get UIIDs, that you must replace with UIIDs from blkid:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/vda1 during installation
UUID=c2f12512-94c1-4676-8292-769a442a6ec8 /               ext4    errors=remount-ro 0       1
# swap was on /dev/vda5 during installation
UUID=9be94068-3948-4196-93f7-94d2c4e2c0f1 none            swap    sw              0       0
14) Run 
sudo sed -i 's/c2f12512-94c1-4676-8292-769a442a6ec8/5c964f3d-e020-4441-a816-72c203214689/g' /etc/fstab
sudo sed -i 's/9be94068-3948-4196-93f7-94d2c4e2c0f1/5aadaaf9-2972-45a6-8286-8ad824fe2034/g' /etc/fstab
15) Check, that /etc/fstab contains only new (from blkid) UIIDs:
cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/vda1 during installation
UUID=5c964f3d-e020-4441-a816-72c203214689 /               ext4    errors=remount-ro 0       1
# swap was on /dev/vda5 during installation
UUID=5aadaaf9-2972-45a6-8286-8ad824fe2034 none            swap    sw              0       0
16) Now you need to update /boot/grub/grub.cfg :
sed -i 's/c2f12512-94c1-4676-8292-769a442a6ec8/5c964f3d-e020-4441-a816-72c203214689/g'  /boot/grub/grub.cfg

sed -i 's/9be94068-3948-4196-93f7-94d2c4e2c0f1/5aadaaf9-2972-45a6-8286-8ad824fe2034/g'  /boot/grub/grub.cfg
17) Check you network interface settings:
 mcedit /etc/network/interfaces
If there are no network interfaces of local machine in /etc/network/interfaces , you need to configure it. For example, on the remote server I have ens18 iface and ens33 iface – on the local machine. In this case you will need to append to the end of the /etc/network/interfaces file:
auto ens33
iface ens33 inet dhcp
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4
Name of the network interface on local machine you can check with 
ifconfig -a
18) Reboot your local machine.