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 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 165: |
Line 165: |
| etc/ssh | | etc/ssh |
| etc/sudoers | | etc/sudoers |
| + | root |
| Save & exit | | Save & exit |
| Ctrl o | | Ctrl o |
Line 202: |
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 216: |
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 225: |
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. |