Changes

From SME Server
Jump to navigationJump to search
4,139 bytes added ,  22:18, 27 October 2020
m
Line 6: Line 6:     
{{#smeversion: smeserver-BackupPC }}
 
{{#smeversion: smeserver-BackupPC }}
 +
{{#smeversion: smeserver-BackupPC4 }}
 
{{#smeversion: BackupPC }}
 
{{#smeversion: BackupPC }}
 +
{{#smeversion: BackupPC4 }}
    
=== Description ===
 
=== Description ===
Line 46: Line 48:     
=== Requirements ===
 
=== Requirements ===
*SME Server 7.X or 8.X
+
*SME Server 7.x, 8.x, 9.x or 10.x.
*a dedicated volume is recommended (can be a simple disk or a RAID array)
+
*A dedicated volume is recommended (can be a simple disk or a RAID array)
    
=== Installation ===
 
=== Installation ===
Line 107: Line 109:  
*updates configuration files following the installation
 
*updates configuration files following the installation
 
  signal-event backuppc-update
 
  signal-event backuppc-update
 +
 +
====install the rpms (SME 10.X)====
 +
yum --enablerepo=smecontribs,epel,fws install smeserver-BackupPC
 +
 +
*updates configuration files following the installation
 +
signal-event backuppc-update
 +
    
You should now be able to access the interface in the server-manager or directly on https://my.domain.tld/BackupPC
 
You should now be able to access the interface in the server-manager or directly on https://my.domain.tld/BackupPC
Line 123: Line 132:     
When you submit, the configuration from smeserver-template will be copied on my_server. You then can edit my_server's config
 
When you submit, the configuration from smeserver-template will be copied on my_server. You then can edit my_server's config
 +
 +
====install the BackupPC4 rpms (SME 9.X)====
 +
Important you can not install both BackupPC (3) and BackupPC4 on the same server.
 +
 +
first the needed repo:
 +
yum install smeserver-extrarepositories-fws smeserver-extrarepositories-epel -y
 +
signal-event yum-modify
 +
then install it:
 +
yum --enablerepo=smecontribs,fws,epel install smeserver-BackupPC4
 +
 +
*updates configuration files following the installation
 +
signal-event backuppc-update
 +
 +
You should now be able to access the interface in the server-manager or directly on https://my.domain.tld/BackupPC
    
=== Upgrade from smeserver-backuppc.fws-3.0-1 ===
 
=== Upgrade from smeserver-backuppc.fws-3.0-1 ===
Line 147: Line 170:     
You should be done ;)
 
You should be done ;)
 +
 +
 +
 +
 +
===upgrade from BackupPC (3) to BackupPC4 rpms (SME 9.X)===
 +
TODO.
 +
You will mostly have some debugging to do regarding the bug {{Bugzilla:10514}}
 +
Also according to BackupPC documentaton this should be doable, but might need some manual tweaking in order to use both v3 and v4 pools during the transition delay:
 +
# http://backuppc.sourceforge.net/BackupPC-4.0.0.html#BackupPC-4.0
 +
# https://github.com/backuppc/backuppc/blob/master/bin/BackupPC_migrateV3toV4
 +
# https://www.srbu.se/index.php?option=com_content&view=article&id=210:migrating-backuppc-v3-pools-to-v4&catid=12&Itemid=121
 +
# https://github.com/backuppc/backuppc/issues/249
    
=== DB properties ===
 
=== DB properties ===
Line 219: Line 254:  
  "cat >> /root/.ssh/authorized_keys2"
 
  "cat >> /root/.ssh/authorized_keys2"
 
  (confirm the host key)
 
  (confirm the host key)
 +
 +
*ssh port different from 22
 +
 +
See this post :
 +
https://forums.contribs.org/index.php/topic,53586.0.html
 +
 +
====Restore or migrate a smeserver====
 +
If you simply want to restore a few files or a whole directory you just have to use the web interface, and within a few clicks you are done, with your files restored directly in place, or aside if you want.
 +
 +
 +
This will cover the opportunity to use this full or almost full backup to use the restoration option while installing a new manager, which will help you to migrate between versions.
 +
 +
* change '''SERVERNAME''' with the actual name of your backup
 +
* change '''-n -1''' with the number of the most uptodate fullbackup you want to use. (-1 means relative to the end: last available in this case)
 +
 +
su - backuppc -s /bin/sh
 +
cd ~
 +
mkdir myrestore
 +
cd myrestore/
 +
 +
to include and restore everything that is outside of the usual backuped folder in SME:
 +
/usr/share/BackupPC/bin/BackupPC_tarCreate  -h SERVERNAME -n -1 -s /  / > smeserver.tar
 +
 +
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
 +
 +
 +
then you have just to copy this on a USB disk, or alternatively copy it in a virtual disk if your SME will be virtualized and can not plug any USB device
 +
mkdir /mnt/MyDisk
 +
mount /dev/disk/by-label/MyDisk /mnt/MyDisk
 +
mv /var/lib/BackupPC/myrestore/smeserver.tar /mnt/MyDisk/
 +
umount /mnt/MyDisk/
 +
 +
# install SME server
 +
# reboot
 +
# plug your drive when you see the screen asking for restoration
 +
 +
and you are done.
    
====Backup a Linux host through rsync====
 
====Backup a Linux host through rsync====
Line 253: Line 327:  
There are several options/versions of rsync – the first I was able to get working was from http://sourceforge.net/projects/backuppc/files/cygwin-rsyncd/2.6.8_0/
 
There are several options/versions of rsync – the first I was able to get working was from http://sourceforge.net/projects/backuppc/files/cygwin-rsyncd/2.6.8_0/
 
The zip file contains 7 files – the site goes into more detail about each of the files.  Depending on how you wish to use BackupPC will determine which files to edit.
 
The zip file contains 7 files – the site goes into more detail about each of the files.  Depending on how you wish to use BackupPC will determine which files to edit.
I use rsync without ssh keys – to do so create a local user with sufficient rights to the directory or directories on the Windows client, then edit the file rsync.secrets to include the UserID & Password.  You then use that same UserID & Password within the configuration from the BackupPC webpage – where you chose to back-up the client with Samba, rsync etc.
+
I use rsync without ssh keys – to do so create a local user with sufficient rights to the directory or directories on the Windows client, then edit the file rsync.secrets to include the UserID & Password.  You then use that same UserID & Password within the configuration from the BackupPC webpage – where you chose to back-up the client with Samba, rsync etc. The contents of rsync.secrets file is simply:
 +
  UserID:Password
 
You will have to create a “Cygwin share” on the Windows box – that is done using the rsync.conf file.  The “Cygwin share” is the name you choose within the square brackets.  My rsync.conf file with a share name of “cdocs” (after removal of all personal information of course) looks like this:
 
You will have to create a “Cygwin share” on the Windows box – that is done using the rsync.conf file.  The “Cygwin share” is the name you choose within the square brackets.  My rsync.conf file with a share name of “cdocs” (after removal of all personal information of course) looks like this:
[cdocs]
+
[cdocs]
 
     path = c:/User
 
     path = c:/User
 
     comment = c: Drive documents
 
     comment = c: Drive documents
Line 265: Line 340:  
     list = false
 
     list = false
   −
We have share name (cdocs), path, the valid user created on the Windows client, the path to the rysnc secrets file, an allowable host (this being the local backup server IP), modes, read only and list.  The options are mostly explained in the file – what it doesn’t show is that if you have a different version of rsync, the rsync.conf file looks a bit different.  This one is for rsync 3.0.9
+
We have share name (cdocs), path, the valid user created on the Windows client, the path to the rysnc.secrets file, an allowable host (this being the local backup server IP), modes, read only and list.  The options are mostly explained in the file – what it doesn’t show is that if you have a different version of rsync, the rsync.conf file looks a bit different.  This one is for rsync 3.0.9
[cdocs]
+
[cdocs]
  Path = /cygdrive/c/Users/<USERNAME>
+
  Path = /cygdrive/c/Users/<USERNAME>
  comment = c: User Data
+
  comment = c: User Data
  strict modes = false
+
  strict modes = false
  auth users = <valid-back-up-user>
+
  auth users = <valid-back-up-user>
  secrets file = c:/rsyncd/rsyncd.secrets
+
  secrets file = c:/rsyncd/rsyncd.secrets
  hosts allow = 192.168.1.1
+
  hosts allow = 192.168.1.1
  read only = false
+
  read only = false
  list = false
+
  list = false
    
The final thing that must happen to make rsync work properly is to load rysnc as a service on the Windows client.  The file service.bat shows the following command to accomplish this:
 
The final thing that must happen to make rsync work properly is to load rysnc as a service on the Windows client.  The file service.bat shows the following command to accomplish this:
c:/rsyncd/rsync.exe -a "--config=c:/rsyncd/rsyncd.conf --daemon --no-detach"
+
c:/rsyncd/rsync.exe -a "--config=c:/rsyncd/rsyncd.conf --daemon --no-detach"
    
There is also a “gotcha” – sometimes port 873 is blocked by Windows Firewall, so you may need to fix that.
 
There is also a “gotcha” – sometimes port 873 is blocked by Windows Firewall, so you may need to fix that.
Line 299: Line 374:     
  nano /var/lib/BackupPC/pc/<client>/backups
 
  nano /var/lib/BackupPC/pc/<client>/backups
With ctrl+k you can remove the line with <backup_number>.
+
With ctrl+k you can remove the line with <backup_number>.
    
Relog to your web interface and voila! No more <backup_number>.
 
Relog to your web interface and voila! No more <backup_number>.
Line 322: Line 397:  
add the directory /var/lib/BackupPC to the PRUNEPATHS list, then  
 
add the directory /var/lib/BackupPC to the PRUNEPATHS list, then  
 
  expand-template /etc/updatedb.conf
 
  expand-template /etc/updatedb.conf
 +
 +
* “aborted by signal=PIPE”
 +
Sometime the backup fails with this error, this error is related to the remote ssh service. You must set in the /etc/ssh/ssh_config of your remote host
 +
 +
  ServerAliveInterval 120
 +
 +
then restart your ssh service
 +
 +
One other way could be to set in the setting of backupPC (RsyncClientCmd)the default value for all hosts
 +
$Conf{RsyncClientCmd} = '$sshPath -o ServerAliveInterval=120 -q -x -l root $host $rsyncPath $argList+';
 +
 +
* trying backing up a SME Server you might encounter error or timeout on ssh, this is because of the AutoBlock function on sshd
 +
config setprop sshd AutoBlock disabled
 +
signal-event remoteaccess-update
 +
{{Tip box|if you disabled Autoblock, install denyhosts or fail2ban not to fall security.}}
    
=== Uninstall ===
 
=== Uninstall ===
Line 332: Line 422:  
Below is an overview of the current issues for this contrib:{{#bugzilla:columns=id,product,version,status,summary|sort=id|order=desc|component=smeserver-backuppc|noresultsmessage=No open bugs found.}}  
 
Below is an overview of the current issues for this contrib:{{#bugzilla:columns=id,product,version,status,summary|sort=id|order=desc|component=smeserver-backuppc|noresultsmessage=No open bugs found.}}  
    +
===Changelog===
 +
Only released version in smecontrib are listed here.
    +
{{ #smechangelog: smeserver-BackupPC}}
    
[[Category: Contrib]]
 
[[Category: Contrib]]
 
[[Category: Backup]]
 
[[Category: Backup]]
3,054

edits

Navigation menu