Custom data backup

NethServer Version: Nethserver 7

Hi,

I want to ask for help with data backup. To the best of my knowledge, Nethserver’s built-in data backup feature does not save mysql and mssql custom databases. How can I backup and restore these?
Should I use mysqldump and sqlcmd in a standalone script for this purpose? If this solution won’t conflict with Nethserver’s built-in backup? Small backup time …

Another question. Is it enough to back up the data on the samba share and emails from the samba shared directory and the vmail directory with the built-in data backup of Nethserver? Is it possible to restore the data this way?

Thank you for your help.

mysql/mariadb databases are included in the builtin backup. If you use MS SQL Server from NethForge, the databases are included too.

Yes, with the default backup you can completely restore a NethServer.
Samba share data and emails are included in the backup.

2 Likes

Thank you @mrmarkuz.

I made a backup of the config and data. The custom mysql and mssql databases are actually included in the data backup. It seems I did not understand the description well. Thank you for your help.

I tried to load it into another Nethserver but I was not successful.

The other Nethserver’s domain name is the same as the original but its network settings are different. IP address, network device names. Therefore, when restoring, I selected the Don’t restore network configuration option.

I tried to restore the config backup but it failed, it wrote an unidentifiable error. The admin and administrator users have disappeared and the test user has not been created.

I don’t understand what happened, nsdc seems to be running.

After that, I did not try to restore the data backup.

Did I do something wrong?

After a restart, the new Nethserver will not be available. With network-recovery I can give an IP address and then I can connect …

After network-recovery you should set an IP address in the network settings.

If the network changed, the samba NSDC container may need an IP that fits to the network, see documentation how to change it.

1 Like

This helped. The WAN interface is available again (Up) and I can connect to the Nethserver. Although I don’t understand why this affects the WAN interface because the Green Interface (Up) was online.

Unfortunately, there are still no admin and administrator users and no group. That’s why I can’t even create …

Maybe you need another reboot? (nsdc restart)
Did you try to restore data?

EDIT:

Are there errors regarding the restore in /var/log/messages ?

I didn’t dare restart it … but you recommended it now and I did it.

And see a miracle! He has become an admin and administrator user again and the user who loaded the config backup has been released! Even the test user password is good! thank you for your idea.
I really don’t understand anything …

I haven’t dared to restore the data backup until it works. I’ll try now.

Unfortunately phpmyadmin is not available, no password is good for it. I hope mysql restore restores …

It should restore it.

I sent my previous email and wanted to restore the data backup but I see the connection is closed by the host …
I wanted to reconnect but Nethserver (Down) is unavailable, WAN interface is unavailable. I was able to connect with the temporary IP given by network-recovery, but all the users disappeared again …

What could be this recurring error?

Did you set an IP in network settings? Network-recovery only sets a temporary IP.

I can’t set an IP address in network settings because the Configuration button is gray.

Here is end of /var/log/masseges file. It started when connaction lost and finish when I can connect with temporary IP:

Feb 4 20:35:48 nethserver sshd[6270]: Timeout, client not responding.
Feb 4 20:35:48 nethserver systemd-logind: Removed session 9.
Feb 4 20:38:23 nethserver systemd-logind: New session 19 of user root.
Feb 4 20:38:54 nethserver systemd: Stopping LSB: Bring up/down networking…
Feb 4 20:38:54 nethserver kernel: br0: port 1(ens33) entered disabled state
Feb 4 20:38:54 nethserver network: A(z) br0 csatoló leállítása: [ OK ]
Feb 4 20:38:54 nethserver kernel: br1: port 2(vb-nsdc) entered disabled state
Feb 4 20:38:54 nethserver kernel: br1: port 1(dummy0) entered disabled state
Feb 4 20:38:54 nethserver network: A(z) br1 csatoló leállítása: [ OK ]
Feb 4 20:38:54 nethserver kernel: device dummy0 left promiscuous mode
Feb 4 20:38:54 nethserver kernel: br1: port 1(dummy0) entered disabled state
Feb 4 20:38:54 nethserver network: A(z) dummy0 csatoló leállítása: [ OK ]
Feb 4 20:38:54 nethserver kernel: device ens33 left promiscuous mode
Feb 4 20:38:54 nethserver kernel: br0: port 1(ens33) entered disabled state
Feb 4 20:38:54 nethserver network: A(z) ens33 csatoló leállítása: [ OK ]
Feb 4 20:38:54 nethserver network: A visszacsatolási eszköz leállítása: [ OK ]
Feb 4 20:38:54 nethserver systemd: Stopped LSB: Bring up/down networking.
Feb 4 20:38:55 nethserver root: Shorewall Stopped
Feb 4 20:38:55 nethserver root: Shorewall Cleared
Feb 4 20:38:55 nethserver kernel: IPv6: ADDRCONF(NETDEV_UP): ens33: link is not ready
Feb 4 20:38:55 nethserver kernel: e1000: ens33 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Feb 4 20:38:55 nethserver kernel: IPv6: ADDRCONF(NETDEV_UP): ens33: link is not ready
Feb 4 20:38:55 nethserver kernel: brtmp: port 1(ens33) entered blocking state
Feb 4 20:38:55 nethserver kernel: brtmp: port 1(ens33) entered disabled state
Feb 4 20:38:55 nethserver kernel: device ens33 entered promiscuous mode
Feb 4 20:38:55 nethserver kernel: e1000: ens33 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
Feb 4 20:38:55 nethserver kernel: IPv6: ADDRCONF(NETDEV_CHANGE): ens33: link becomes ready
Feb 4 20:38:55 nethserver kernel: brtmp: port 1(ens33) entered blocking state
Feb 4 20:38:55 nethserver kernel: brtmp: port 1(ens33) entered forwarding state
Feb 4 20:39:20 nethserver cockpit-session: pam_ssh_add: Failed adding some keys
Feb 4 20:39:20 nethserver systemd-logind: New session 21 of user root.
Feb 4 20:39:21 nethserver cockpit-ws: logged in user session
Feb 4 20:39:21 nethserver cockpit-ws: New connection to session from 192.168.1.2
Feb 4 20:39:21 nethserver dbus[802]: [system] Activating via systemd: service name=‘org.freedesktop.hostname1’ unit=‘dbus-org.freedesktop.hostname1.service’
Feb 4 20:39:21 nethserver systemd: Starting Hostname Service…
Feb 4 20:39:21 nethserver dbus[802]: [system] Successfully activated service ‘org.freedesktop.hostname1’
Feb 4 20:39:21 nethserver systemd: Started Hostname Service.
Feb 4 20:39:21 nethserver dbus[802]: [system] Activating via systemd: service name=‘org.freedesktop.timedate1’ unit=‘dbus-org.freedesktop.timedate1.service’
Feb 4 20:39:21 nethserver systemd: Starting Time & Date Service…
Feb 4 20:39:21 nethserver dbus[802]: [system] Successfully activated service ‘org.freedesktop.timedate1’
Feb 4 20:39:21 nethserver systemd: Started Time & Date Service.
Feb 4 20:39:22 nethserver cockpit-bridge: No entry for terminal type “unknown”;
Feb 4 20:39:22 nethserver cockpit-bridge: using dumb terminal settings.
Feb 4 20:39:22 nethserver cockpit-bridge: (A hálózat elérhetetlen): IO::Socket::INET6: connect: A hálózat elérhetetlen
Feb 4 20:39:22 nethserver cockpit-bridge: (A hálózat elérhetetlen): IO::Socket::INET6: connect: A hálózat elérhetetlen
Feb 4 20:39:32 nethserver cockpit-bridge: No entry for terminal type “unknown”;
Feb 4 20:39:32 nethserver cockpit-bridge: using dumb terminal settings.
Feb 4 20:39:32 nethserver cockpit-bridge: No entry for terminal type “unknown”;
Feb 4 20:39:32 nethserver cockpit-bridge: using dumb terminal settings.
Feb 4 20:39:41 nethserver cockpit-bridge: No entry for terminal type “unknown”;
Feb 4 20:39:41 nethserver cockpit-bridge: using dumb terminal settings.
Feb 4 20:39:42 nethserver cockpit-bridge: (A hálózat elérhetetlen): IO::Socket::INET6: connect: A hálózat elérhetetlen
Feb 4 20:39:42 nethserver cockpit-bridge: (A hálózat elérhetetlen): IO::Socket::INET6: connect: A hálózat elérhetetlen
Feb 4 20:41:22 nethserver nmbd[1265]: [2022/02/04 20:41:22.445553, 0] …/…/source3/libsmb/nmblib.c:924(send_udp)
Feb 4 20:41:22 nethserver nmbd[1265]: Packet send failed to 192.168.10.255(138) ERRNO=A hálózat elérhetetlen
Feb 4 20:41:22 nethserver nmbd[1265]: [2022/02/04 20:41:22.446283, 0] …/…/source3/libsmb/nmblib.c:924(send_udp)
Feb 4 20:41:22 nethserver nmbd[1265]: Packet send failed to 192.168.10.255(138) ERRNO=A hálózat elérhetetlen
Feb 4 20:41:31 nethserver systemd: Starting Cleanup of Temporary Directories…
Feb 4 20:41:31 nethserver systemd-tmpfiles: [/etc/tmpfiles.d/opendkim.conf:1] Duplicate line for path “/var/run/opendkim”, ignoring.
Feb 4 20:41:31 nethserver systemd: Started Cleanup of Temporary Directories.
Feb 4 20:42:29 nethserver nmbd[1265]: [2022/02/04 20:42:29.006694, 0] …/…/source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
Feb 4 20:42:29 nethserver nmbd[1265]: *****
Feb 4 20:42:29 nethserver nmbd[1265]:
Feb 4 20:42:29 nethserver nmbd[1265]: Samba name server NETHSERVER is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.140
Feb 4 20:42:29 nethserver nmbd[1265]:
Feb 4 20:42:29 nethserver nmbd[1265]: *****
Feb 4 20:42:57 nethserver sssd[be[diakont.eu]]: Backend is offline
Feb 4 20:45:46 nethserver cockpit-ws: New connection to session from 192.168.1.2
Feb 4 20:47:27 nethserver nmbd[1265]: [2022/02/04 20:47:27.137985, 0] …/…/source3/libsmb/nmblib.c:924(send_udp)
Feb 4 20:47:27 nethserver nmbd[1265]: Packet send failed to 192.168.10.255(138) ERRNO=A hálózat elérhetetlen
Feb 4 20:47:27 nethserver nmbd[1265]: [2022/02/04 20:47:27.138048, 0] …/…/source3/libsmb/nmblib.c:924(send_udp)
Feb 4 20:47:27 nethserver nmbd[1265]: Packet send failed to 192.168.10.255(138) ERRNO=A hálózat elérhetetlen
Feb 4 20:47:39 nethserver chronyd[808]: Source 193.225.118.163 replaced with 162.159.200.1
Feb 4 20:48:10 nethserver cockpit-ws: Error receiving data: Network is unreachable
Feb 4 20:48:10 nethserver cockpit-ws: error closing web socket stream: Error sending data: Broken pipe
Feb 4 20:48:10 nethserver cockpit-ws: WebSocket from 192.168.1.2 for session closed
Feb 4 20:48:25 nethserver cockpit-ws: session timed out
Feb 4 20:48:26 nethserver systemd-logind: Removed session 2.
Feb 4 20:48:45 nethserver chronyd[808]: Can’t synchronise: no selectable sources
Feb 4 20:49:03 nethserver sshd[10678]: Accepted keyboard-interactive/pam for root from 192.168.1.2 port 53358 ssh2
Feb 4 20:49:03 nethserver systemd-logind: New session 36 of user root.

Could you share a screenshot of the network settings page? I think there should be other interfaces to configure.

Here is a documentation of the network-recovery tool:

You could try to remove the bridge and recreate it.

There’s a warning, maybe you should start over with “Restore network config” enabled:

Restoring a local Samba Active Directory without the Restore network configuration option enabled is highly discouraged. Read carefully this section.

EDIT:

Here are instructions for resetting the network configuration on command line.

1 Like

I made a new Nethserver to test the backups. To do this, I installed CentOS minimal under VMware Player and created a dummy interface as the Green interface. This simulates the VPS service. To do this, I wanted to upload the data and config saved from a working Nethserver.

I would like to install Nethserver on a VPS for a service provider later. For this, however, I need to be able to upload the config and data backups without the network settings because they will definitely change.
I ran the Samba Active Directory reconfiguration again according to the documentation. I can connect for now and everything seems to be working and users have reappeared. Now I’m waiting to see if the problem occurs again … If it’s ok, I’ll upload the data backup.

It would be good to have a scenario on how to migrate Nethserver to VPS …

Usually Disaster recovery should work to migrate to another server.

Another way is rsync.

1 Like

I read and used this to move the server but I ran into the above problems …
Rsync is a good solution for uploading data, but it works fine if I create the config manually on the new server with users, shares, etc together before that.

Hi

I do have to migrate a NethServer this weekend from a Home Installation to a cloud this weekend. As the Home Server contains an extensive media collection which we do not intend to move to the cloud, we need to resize the disk and other considerations…

So I’ll once again use the rsync method, actually glad @mrmarkuz provided a convienient link back to that post so I don’t have only my old notes to rely on… :slight_smile:

A main intention is to reduce the NethServer size from >700 GB down to 3-400 GB for online use. The Home NethServer will remain in situ.

My 2 cents
Andy

1 Like

Hello,
that would interest me too. Would you describe the whole process step by step so that it can be reproduced if necessary?
It would help a lot and maybe it will be revealed why there is a problem with my relocation …
Thanks for your help.