Koozali.org: home of the SME Server

Backing up big server

Offline brainamess

  • *
  • 39
  • +0/-0
Backing up big server
« on: January 16, 2023, 08:21:03 PM »
Good afternoon!

I am looking at ways to back up my SME10 server and I liked how affa worked on 9 but I see all kinds of warnings to not use it as a reliable backup for 10.

I am wondering what people use to safely backup their servers. Is there an all in one way? I have read a lot in https://wiki.koozali.org/Backup_server_config and it looks like you can scp the files to the restored server. I would love to know what is working for someone, specifically if your server is between 500GB to 1TB.

I appreciate any input!

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Backing up big server
« Reply #1 on: January 16, 2023, 10:34:44 PM »
the affa guys are close, have it just about there, one may add here, not on repos yet still in local testing repos..I know some use BackupPC and are happy with it, its more than just for backuping up desktops etc
--
qui scribit bis legit

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Backing up big server
« Reply #2 on: January 16, 2023, 10:45:32 PM »
1 tb is small.

give a try to backuppc.

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Backing up big server
« Reply #3 on: January 17, 2023, 12:13:06 AM »
The issues with affa were related partly to a security update to rsync from upstream which broke some things, and a review of the code to update it which found some issues with affa (existing backups should be ok unless you have updated rsync in which they are now non existent).

I have some code that is nearly there save for a couple of small issues I am trying to fix, but keep finding work getting in the way.

You are welcome to help test. We discuss development on our RocketChat server.

PM me for a login if you want to help.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline brainamess

  • *
  • 39
  • +0/-0
Re: Backing up big server
« Reply #4 on: January 17, 2023, 02:36:45 PM »
Thank you for all this input. I will try backuppc and I will be PMing about affa to help test soon!

Thank you so much!

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Backing up big server
« Reply #5 on: January 17, 2023, 05:16:55 PM »
Thank you for all this input. I will try backuppc and I will be PMing about affa to help test soon!

Yes these things don't get built by themselves - they are hacked together by a tiny group of volunteers who need all the help they can get!

You do not have to be a coder to help. A spare box - preferably a virtual machine, some patience, and a bit of your time is all that is needed. And no - we don't have much time either :-)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline brainamess

  • *
  • 39
  • +0/-0
Re: Backing up big server
« Reply #6 on: March 01, 2023, 07:07:46 PM »
Before I even begin to attack affa I need to be sure my backuppc solution is flawless.

I read the backup documentation https://wiki.koozali.org/BackupPC and I read this.

The base backup in the SME Server console would be an equivalent to this :

 /usr/share/BackupPC/bin/BackupPC_tarCreate  -h SERVERNAME -n -1 -s  /    home/e-smith etc/e-smith/templates-custom etc/e-smith/templates-user-custom \
etc/ssh root etc/sudoers  etc/passwd  etc/shadow etc/group etc/gshadow etc/samba/secrets.tdb  etc/samba/smbpasswd > smeserver.tar

so breaking that down I need to backup:

 /home/e-smith /etc/e-smith/templates-custom /etc/e-smith/templates-user-custom /etc/ssh /root /etc/sudoers /etc/passwd /etc/shadow /etc/group /etc/gshadow /etc/samba/secrets.tdb /etc/samba/smbpasswd

I have been doing this and when I restore these directories to a fresh SME10 install my server isn't trying to pull emails and so nothing is really working.
On the other hand if I backup just /home/e-smith and restore it to an SME10 server that is already restored but with an older backup, it seems to work.

I am afraid that doing this I am missing something important and eventually my backups will be useless. Can someone confirm what I should be backing up.

My backuppc server is on a different machine than on my actual SME10 server.

I appreciate any help with this.

Offline Jean-Philippe Pialasse

  • *
  • 2,762
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Backing up big server
« Reply #7 on: March 02, 2023, 05:11:34 AM »
Code: [Select]

 /usr/share/BackupPC/bin/BackupPC_tarCreate  -h SERVERNAME -n -1 -s  /    home/e-smith etc/e-smith/templates-custom etc/e-smith/templates-user-custom \
etc/ssh root etc/sudoers  etc/passwd  etc/shadow etc/group etc/gshadow etc/samba/secrets.tdb  etc/samba/smbpasswd > smeserver.tar


this should be done on the server with backuppc as user backuppc to obtain a tar file you can  copy on a usb disk you then connect to the newly installed machine you want to restore. 

also please be aware
- you need to use the actual name of the server backuped in backuppc as shown in backuppc for this command
- if you use the smeserver template provided with the contrib your backup should included the needed directories and files.

Offline Gary Douglas

  • *
  • 70
  • +1/-0
Re: Backing up big server
« Reply #8 on: March 02, 2023, 11:49:28 PM »
If you have the disk space, run AFFA3/4 as well. Affa 3.3.1-11 in smetest is good on SME10 up to rsync-3.1.2-10. AFFA4 is very close, lots been logged in rocketchat, the more testers the merrier.

Offline smeghead

  • *
  • 557
  • +0/-0
Re: Backing up big server
« Reply #9 on: April 15, 2023, 07:54:03 PM »
I've taken the info from the built in backup, expanded upon it, & built it into 2 scripts, one for SMB backup to a LAN workstation & one to backup to a USB drive plugged into the SME itself; I've used them with backup files up to approx 80GB without issue (prob 150GB+ raw files), mind you the servers tend to be pretty capable multicore with at least 8GB ram & ssd storage.

These are tailored to suit me & my system(s) but are easily modded to suit another; I currently have them running as a scheduled task on 4 servers.

The scripts assume that the local drive has enough space to create the tgz backup file so if the drive is really full they won't work.  I use a tgz file to allow me to backup all file perms that would otherwise be lost if natively backing up files to a Windows share.

I also use Lazy Admin Tools (https://wiki.koozali.org/Lazy_Admin_Tools) 'lat-dump -d' to take a snapshot of the core setup, again for primarily for reference only, but somtimes to reconfigure the new server using 'lat-restore -a'.

The scripts backup the following:

/root
/etc/e-smith/templates
/etc/e-smith/templates-user
/etc/e-smith/templates-custom
/etc/e-smith/templates-user-custom
/etc/ssh
/etc/sudoers
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/samba/secrets.tdb
/etc/samba/smbpasswd
/home/e-smith

Note:  I always restore files manually or use them as a reference instead of restoring, particularly files belonging to yum or rpm based contribs.

I can sanitize these scripts & post if you think they may be of use.
..................

Offline ReetP

  • *
  • 3,731
  • +5/-0
Re: Backing up big server
« Reply #10 on: April 16, 2023, 12:40:15 AM »
And we have built the first Affa 4 rpm which is in my test repo as we iron out a few wrinkles.

https://www.reetspetit.com/smetest/7/repoview/smeserver-affa.html

Probably import to SME repos next week.

Don't use it in production - or at least don't rely on it as your only backup right now!

Testers welcome!
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation