Nethserver backup issues

Nethserver 7.9.2009 final
Module Backup

Hi,
I save the data from the Nethserver with the Backup module.

I would like to know if the script running during the save stops the individual modules in sequence (database server, mail, SOGo, etc.) when it saves the data from the individual applications?

I’m asking because during the save, e.g. mail may arrive, files may be modified, and changes may occur in databases during the backup. There can be many reasons for this. For example, the work is not completed until the backup is started or an email is received after the backup is started…

This can cause problems with the saved data, it is not included in the save as in the source. Changing the file can also cause problems during saving…

What can be a good solution against data loss or data corruption?

Thanks and Regards

@steve

Hi Steve

For my clients I use a double strategy:

NethServer does it’s backups to a NAS.

As NethServer runs virtually in Proxmox, I also let Proxmox do a backup (Some clients 4x daily!) using PBS.

The resullts of both are kept also offsite, synched daily offsite.

If one had a bad timing, the other will work. So far Proxmox has always worked, never needed to resort to using NethServer’s backup.

My 2 cents
Andy

1 Like

Hi Andy,

Do you sync the PBS server offsite ?

And for the NAS, is it NAS->NAS sync or sync to Cloud ?

However the question asked was what happens if the backup was interrupted during the backup process?

I am using USB backup automatically using restic and few times, I faced with lot of power outrage error due to faulty UPS (which is now replaced) and found that if the backup fails than you will not find the backup file rather the tmp file, which is not removed with the retention policy, and it actually filled all my backup space, which I had to remove it manually.

Hi

No, the client has a NAS and a PBS Offsite (eg At Home), and an OPNsense firewall (IPsec VPN).
The NAS are Synplogy, which provides for NAS → NAS…
The PBS at home collects the VM Backups from the PBS in the office.

As PBS and Nethserver Backups run at different times, as long as one of those two are intact and working, WHO cares? :slight_smile:

That is what Zabbix monitoring is for… :slight_smile:
Backup done, disk space makes no big jumps!

My 2 cents
Andy

Hi @Andy_Wismer,

thank you for sharing your rescue solution with us. The information is useful.

Unfortunately, that’s not exactly what the question was about.

In order to prevent the above problems, I usually stop the services one by one during the backup and start them again after saving the related data. This can usually be easily solved with a script.

However, according to my experience, Nethserver’s built-in Backup module does not work this way and this can cause data damage or data errors.

I would like to know if there is a solution to prevent this?

Thanks and Regards

Do you mean to say that you stop the service manually before the backup ? Could you elaborate on the data damage/data error part

Hi

I have in the last 5 years using NethServer NEVER bothered with this.

For one, the databases are first dumped seperately to /var/lib/nethserver/backups and then (later) included in the backup.

Most backup systems out there use a so called snapshot system to define the moment a backup is done, no matter if Windows or Linux, this way file systems are kept intact and correctly working…

There will ALWAYS be mails coming in during backup time of NethServer - as it’s off office hours, most will be SPAM, but one or two may be legit mail.
So what? It will be included in the next backup. (As said, for certain clients I do 4 backups a day!).

So the real issue is you’re trying to out-think the backup, which already has it all thought out - and your ass covered for that worst case!
Don’t stop ANY services and restart them afterwards! NethServer needs the services running for a decent, working backup!
For example, MySQL must be running for a decent backup dump!

:slight_smile:

My 2 cents
Andy

@nio707
I cannot use this solution on the Nethserver. For example, I save with rsync on an ubuntu server. I wrote a script for this, which e.g. when saving emails, stop postfix and then start it with the systemctl stop/start postfix.service command.
Of course, I don’t stop mysqld because I saved the databases with sqldump… Mysql databases can be saved by copying the database directories if mysqld is stopped, but I do not use this solution.

@Andy_Wismer
Maybe I’m overthinking it, but I’m trying to be as safe as possible. Is this a bad idea?

I run Nethserver on physical hardware in a non-virtualized environment. There is no Proxmox or other solution, so there is no snapshot of the system. I use ext4 file system not e.g. btrfs.
I think that since you haven’t had to restore the system yet, you probably haven’t encountered any problems with data loss during the restoration of the backup. Unfortunately, I’ve been this way before…

I apologize if I stirred the water…

Thanks and Regards

@steve

I’ve more than once had to resort to disaster recovery.

Sh*t happens, like unplanned outages while the UPS is being replaced, defective new hardware, whatever…
Don’t forget, I’ve been in this business for over 35 years now and have had to deal with all kinds of hardware and situations… :slight_smile:

The really great thing about Proxmox is it makes the restore basically hardware independent. I can install Proxmox on virtually any hardware within 20 minutes, and then restore from PBS or restart running VMs (those using shared storage), whatever. As I use the virtual CPU, even a Windows server does not detect a change from an Intel CPU to an AMD or vica-versa.

Note:

Just for your Info: NethServer, out of the box, will use a XFS file system, much more stabler and performant than ext4. So using ext4 is a downgrade in service quality and availability.

My 2 cents
Andy

And I think that MySQL can be the closest thing to what you cannot obtain… If you start a dump/backup, the next transaction receive make that dump obsolete. And you can’t avoid that.
If the environment desperately needs the frozen absolute believe to have everything that’s written into the server at that time, the closest thing seems a VM snapshot. On the other end, I’m thinking of an environment clustered and redundant
Otherwise, any backup procedure (AFAIK), including your rsync script, is consistent for the time the procedure starts, even the one on Windows that rely on shadow copies, and that can allow the system to modify a file when it’s still under backup procedure.

@Andy_Wismer
I am glad that I can discuss my problems with an experienced restoration specialist. Thank you very much for your help and suggestions.
Unfortunately, I don’t know Proxmox thoroughly, I’ve never used it. I need a faster solution now. I will have time to deal with Proxmox later, but it will take longer. I need to move the current server to a server hosting provider in a short period of time. Unfortunately, due to virtualized Windows, I cannot use a VPS, the cost of two VPSs and mainly the security of Windows is not suitable for me.
It should be considered that the KVM virtualized host under Nethserver should also be created as an independent host under Proxmox. This will require some further development. Previously, btrfs snapshot was useful under SuSE…

@pike

I think this is the most important statement that must be accepted. In this case, what is left out of the backup will not cause problems if I choose the right time to save. I think this will be the solution. Thank you for your help.

Another question.
How can I save data from the virtualized host using the Backup module?
If I want to save to Nextcloud or Owncloud storage, will this not work with the self-signed certificate? Currently it doesn’t work with just http…

Is it possible to save to Google Drive using WebDav backup? I can’t connect to it…

Thanks and Regards

Hi @steve

You’re greatly underestimating your own capabilities, und overestimating Proxmoxes complexities!
Like here: “It should be considered that the KVM virtualized host under Nethserver should also be created as an independent host under Proxmox.”.
Proxmox uses KVM under the hood, so you can use the VM “as is”!

Proxmox is really easy to use. I use it myself in a hosted environment (Hetzner, running in Finnland). My environment:

In the above environment, the OPNsense firewall is also virtualized and runs inside Proxmox.
After any reboot of Proxmox, all is up and running within 5 Minutes. (All NVME environment!).
Proxmox is directly accessible (For setup & administration).

I can offer you a quick starter set per Anydesk (and eg Telegram for voice) if you’re interested, drop me a PM if yes…
You can be up and running saftely within 2 days or less!

:slight_smile:

You also aren’t the first! So far, all have become Proxmox fans!

My 2 cents
Andy

AFAIK, the backup is “up to the module” for the management, and the procedure (if available) runs some pre-backup files to prepare the data for the transfer into various backup endpoints.
More on that here
https://docs.nethserver.org/en/v7/third_party.html
https://docs.nethserver.org/en/v7/backup_customization.html#backup-customization-section

Did you asked Google support?

@Andy_Wismer
Thank you for your offer, I will look for you when I get there to start trying it out.

Thank you @pike I

I will try it because I have installed the Firebird database manager, I have prepared a service control for it in Cockpit, but I also need to save the firebird databases.

In principle, I can save databases from virtualized Windows, e.g. under /usr/local, but it should also be added to the save path.

I didn’t consult with Google because I wanted to find someone for whom it works first. On the other hand, I have no idea how to contact Google about this problem. :frowning:

I hope that you will find someone which already did this thing… Unfortunately, doing support in spite of Google is quite a tough task.

Can we go back to the first part of the question?

I run my owncloud server, but it does not have an authentic certificate. It has its own self-signed certificate. The Nethserver Backup module can connect to it with http, but for some unknown reason it cannot connect to it with https.

What could be the reason for this?

Hi @steve

Most PHP / JAVA based Apps (Including Nextcloud) won’t work without a valid SSL cert. But nowadays, with LetsEncrypt, there’s no real reason to use a self encrypted cert…

My 2 cents
Andy

Thanks, that’s what I was afraid of…

Unfortunately, Nextcloud is on the same network as owncloud, which I want to use as backup storage. Nethserver has a public static IP address and a Let’s Encrypt certificate. Unfortunately, Nextcloud running on Nethserver is not good for saving, because then it would save itself… :frowning:

So I can’t use another server with a public IP address and Let’s Encrypt.

And virtualhost separately Owncloud and Nextcloud with public reverse proxy? Or with a different application name (e.g. my.server.org/owncloud and my.server.org/nextcloud) This would allow to have a certificate valid for both virtual hosts or for the same hostname with different applications name.

The owncloud runs on another server in the local network not on the Nethserver.
The owncloud is configured as an Apache virtual host on another server (not Nethserver).

My public static IP address is registered in the public DNS and the TCP ports 80/443 are directed to the Nethserver. That is why it is not possible to register another server with a public IP address in the public DNS, so Let’s Encrypt will not work well because owncloud server is not accessible from the Internet… :frowning: