Changes

Jump to navigation Jump to search
2,062 bytes added ,  11:59, 21 April 2021
m
Line 1: Line 1: −
== Backup server configuration ==
+
{{usefulnote}}
 +
==Backup the server configuration==
    
===Overview===
 
===Overview===
   −
{{Warning box|This is a non standard method of transferring data between servers and should be carefully used to ensure that no data is lost or altered during the process. If wrong or inappropriate copying procedures are used, your data may have incorrect permissions applied. Using tar and scp is the "best" way to transfer files directly between servers while retaining correct permissions/ownership in the process.}}
+
{{Warning box|This is a non-standard method of transferring data between servers and should be used carefully to ensure that no data is lost or altered during the process. If wrong or inappropriate copying procedures are used, your data may have incorrect permissions applied. Using tar and scp is the "best" way to transfer files directly between servers while retaining correct permissions/ownership in the process.}}
      Line 18: Line 19:  
If you have large amounts of data in other locations that will cause your backup file to exceed 2Gb, then that data should also be temporarily moved to the /temp folder, and manually copied to the new server after the restore.
 
If you have large amounts of data in other locations that will cause your backup file to exceed 2Gb, then that data should also be temporarily moved to the /temp folder, and manually copied to the new server after the restore.
   −
{{Note box|With sme 7.2 or newer, it is possible to create a backup to desktop smeserver.tgz file of the order of 52Gb, when saved to a share or a connected drive formatted with a NTFS or ext3 file system and when using Firefox as the browser. See bug 81.}}
+
{{Note box|msg=With sme 7.2 or newer, it is possible to create a backup to desktop smeserver.tgz file of the order of 52Gb, when saved to a share or a connected drive formatted with a NTFS or ext3 file system and when using Firefox as the browser. [[bugzilla:81]].}}
      Line 31: Line 32:       −
<ol></li><li>On the server to be backed up (server1) do
+
<ol><li>On the server to be backed up (server1) do
 
  mkdir -p /temp
 
  mkdir -p /temp
mv /home/e-smith/files/users /temp
+
mv /home/e-smith/files/users /temp
mv /home/e-smith/files/ibays /temp
+
mv /home/e-smith/files/ibays /temp
mv /home/e-smith/files/xxxx /temp
+
mv /home/e-smith/files/xxxx /temp
    
</li><li>Perform backup to desktop on server1 using the standard server manager panel
 
</li><li>Perform backup to desktop on server1 using the standard server manager panel
Line 41: Line 42:  
</li><li>Then on server1 do
 
</li><li>Then on server1 do
 
  mv /temp/users /home/e-smith/files/
 
  mv /temp/users /home/e-smith/files/
mv /temp/ibays /home/e-smith/files/
+
mv /temp/ibays /home/e-smith/files/
mv /temp/xxxx /home/e-smith/files/
+
mv /temp/xxxx /home/e-smith/files/
    
</li><li>Build another server to restore to (server2), and perform a fresh install of sme server on it. Note that any preferred hardware can be used, it does not need to be physically identical to the original server the backup was performed on.
 
</li><li>Build another server to restore to (server2), and perform a fresh install of sme server on it. Note that any preferred hardware can be used, it does not need to be physically identical to the original server the backup was performed on.
Line 63: Line 64:  
Modify the following commands appropriately to only move the data you require.
 
Modify the following commands appropriately to only move the data you require.
   −
<ol></li><li>Use tar to compress all the user and ibays folders (on server1) by doing
+
<ol><li>Use tar to compress all the user and ibays folders (on server1) by doing
 
  cd /home/e-smith/files
 
  cd /home/e-smith/files
tar -czvf /temp/users.tar.gz users
+
tar -czvf /temp/users.tar.gz users
tar -czvf /temp/ibays.tar.gz ibays
+
tar -czvf /temp/ibays.tar.gz ibays
tar -czvf /temp/xxxx.tar.gz xxxx
+
tar -czvf /temp/xxxx.tar.gz xxxx
    
</li><li>Use scp to copy the tarred files between machines by doing (on server1)
 
</li><li>Use scp to copy the tarred files between machines by doing (on server1)
Line 76: Line 77:     
If ssh is configured for a different port (than 22) use
 
If ssh is configured for a different port (than 22) use
  scp -P zzzz /temp/users.tar.gz server2IP:/home/e-smith/files/
+
   
 +
scp -P zzzz /temp/users.tar.gz server2IP:/home/e-smith/files/
 
  scp -P zzzz /temp/ibays.tar.gz server2IP:/home/e-smith/files/
 
  scp -P zzzz /temp/ibays.tar.gz server2IP:/home/e-smith/files/
 
  scp -P zzzz /temp/xxxx.tar.gz server2IP:/home/e-smith/files/
 
  scp -P zzzz /temp/xxxx.tar.gz server2IP:/home/e-smith/files/
Line 84: Line 86:  
</li><li>Use tar to uncompress all the user and ibay folders by doing (on server2)
 
</li><li>Use tar to uncompress all the user and ibay folders by doing (on server2)
 
  cd /home/e-smith/files/
 
  cd /home/e-smith/files/
tar -xvzf users.tar.gz
+
tar -xvzf users.tar.gz
tar -xvzf ibays.tar.gz
+
tar -xvzf ibays.tar.gz
tar -xvzf xxxx.tar.gz
+
tar -xvzf xxxx.tar.gz
rm /home/e-smith/files/users.tar.gz
+
rm /home/e-smith/files/users.tar.gz
rm /home/e-smith/files/ibays.tar.gz
+
rm /home/e-smith/files/ibays.tar.gz
rm /home/e-smith/files/xxxx.tar.gz
+
rm /home/e-smith/files/xxxx.tar.gz
 
   
If required, to correct ownership for each user on server2 do
 
If required, to correct ownership for each user on server2 do
   
  cd /home/e-smith/files/users
 
  cd /home/e-smith/files/users
chown -R username:username username
+
chown -R username:username username
 
</li></ol>
 
</li></ol>
   Line 154: Line 154:  
Edit the file to contain the following (which is a deviation from the standard backup inclusion set of files & folders)
 
Edit the file to contain the following (which is a deviation from the standard backup inclusion set of files & folders)
 
  home/e-smith/
 
  home/e-smith/
  etc/e-smith/
+
  etc/e-smith/templates-custom
 +
etc/e-smith/templates-user-custom
 
  etc/group
 
  etc/group
 
  etc/gshadow
 
  etc/gshadow
Line 164: Line 165:  
  etc/ssh
 
  etc/ssh
 
  etc/sudoers
 
  etc/sudoers
 +
root
 
Save & exit
 
Save & exit
 
  Ctrl o
 
  Ctrl o
Line 201: Line 203:  
  perl -e 'use esmith::Backup; $b = new esmith::Backup;print join("\n",$b->restore_list)'
 
  perl -e 'use esmith::Backup; $b = new esmith::Backup;print join("\n",$b->restore_list)'
   −
Which on a sme7.5.1 server shows:
+
Here is the output on three versions of SME. The difference between SME 7.5 and the others is important.  
    +
{| class="wikitable"
 +
|-
 +
!SME 9!!SME 8.2!!SME 7.5.1
 +
|-
 +
|
 +
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
 +
||
 +
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
 +
||
 
  home/e-smith
 
  home/e-smith
 
  etc/e-smith/templates-custom
 
  etc/e-smith/templates-custom
Line 215: Line 248:  
  etc/samba/secrets.tdb
 
  etc/samba/secrets.tdb
 
  etc/samba/smbpasswd
 
  etc/samba/smbpasswd
  etc/smbpasswd
+
  etc/smbpasswd  
 
+
|}
    
All files/scripts associated with the standard backup and restore processes can be found with this command.
 
All files/scripts associated with the standard backup and restore processes can be found with this command.
Line 224: Line 257:  
The inclusion list can be found in
 
The inclusion list can be found in
   −
/usr/lib/perl5/site_perl/esmith/Backup.pm
+
/usr/lib/perl5/site_perl/esmith/Backup.pm
 +
 
 +
In SME 9.2 it is at:
 +
/usr/share/perl5/vendor_perl/esmith/Backup.pm
 +
 
 +
{{Note box|Please note that the path to emsith perl libraries as of SME Server 9.x has changed to '''/usr/share/perl5/vendor_perl/esmith'''.}}
    
Changes to this file will be overwriten during upgrades.
 
Changes to this file will be overwriten during upgrades.
 +
 +
===Modifying the standard backup inclusions & exclusions===
 +
 +
To modify the included & excluded folders & files, refer to http://wiki.contribs.org/Backup_with_dar#Adding.2FExcluding_Directories_and_Files_from_the_backup_list
    
==Data size calculation for backups==
 
==Data size calculation for backups==
Line 385: Line 427:     
The DAR2 contrib has a web interface that is configurable and allows you to create the disaster recovery backup (ie all data and configuration) required to rebuild a server, but you still need to reinstall add on contribs (rpms). It also allows selective backup jobs to be done, eg of certain ibays only, depending on your particular needs.
 
The DAR2 contrib has a web interface that is configurable and allows you to create the disaster recovery backup (ie all data and configuration) required to rebuild a server, but you still need to reinstall add on contribs (rpms). It also allows selective backup jobs to be done, eg of certain ibays only, depending on your particular needs.
 +
 +
====Cifs Error====
 +
When using the included backup functionality, or the DAR2 contrib, backing up to a windows remote share generates the following cifs errors. see [[bugzilla:7341]]
 +
Feb 12 11:51:25 sme e-smith-bg: Connecting /mnt/dar2/backup to \\192.168.10.30\bkp
 +
Feb 12 11:51:25 sme kernel:  CIFS VFS: Send error in SessSetup = -12
 +
Feb 12 11:51:25 sme kernel:  CIFS VFS: cifs_mount failed w/return code = -12
 +
Feb 12 11:51:25 sme e-smith-bg: mount error(12): Cannot allocate memory
 +
Feb 12 11:51:25 sme e-smith-bg: Refer to the mount.cifs
 +
 +
The solution could be to modify the windows registry by the file below
 +
 +
Windows Registry Editor Version 5.00
 +
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management]
 +
"LargeSystemCache"=dword:00000001
 +
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]
 +
"Size"=dword:00000003
 +
 +
Save the content above in a file with the name W7-backup.reg and import it in the windows registry, restart the service or the Windows computer
    
==Reference links==
 
==Reference links==

Navigation menu