Koozali.org: home of the SME Server

Restore data

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Restore data
« on: March 30, 2021, 12:06:16 PM »
I noticed on ather thread that you can restore data from the command line.
As affa moves a load of stuff over is it possible to just restore the data and stock sme stuff (users, email, data) but not the bits that break things. Then manually re add contribs, settings etc on the new server.
For example I've been using and moving sme since 7b6 and I'm sure there is lots of rubbish I don't need moved and will probably cause me problems.

Online Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Restore data
« Reply #1 on: March 30, 2021, 05:26:35 PM »
If you simply use the console backup this is exactly what it will do:
backup   
Code: [Select]
my @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',
    );

the restore from console will then restore all those files, merge group, shadow and passwd files with the existing ones (when reinstalling from scratch some deamon uid will change)

Fron that very basic backup you will miss most of those contribs backup.
For instance :
- let's encrypt /etc/dehydrated
- sme9admin /var/lib/sme9admin
- phpki /opt/phpki
...

Those would need to be backup manually. Starting SME10 you will be able to include some folders to the console backup...

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Restore data
« Reply #2 on: March 31, 2021, 02:25:01 AM »
Thanks jpp
Is is possible to do that for a mong like me.
That seems to give an easy upgrade path without affa?

Offline jameswilson

  • ****
  • 739
  • +0/-0
    • Security Warehouse, trade security equipment
Re: Restore data
« Reply #3 on: March 31, 2021, 02:26:43 AM »
Sorry just reread,
So the console backup gives exactly what I'm saying, anyone one would think you lot were genius
Thanks I'll try it out I've always used affa

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: Restore data
« Reply #4 on: March 31, 2021, 02:53:28 AM »
Affa is undergoing surgery right now :lol:

Not sure it'll do an upgrade as there are loads of differences between versions and too easy to break stuff.

Will still be excellent for same version backups.
...
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 TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Restore data
« Reply #5 on: March 31, 2021, 03:51:13 AM »
Sorry just reread,
So the console backup gives exactly what I'm saying, anyone one would think you lot were genius
Thanks I'll try it out I've always used affa

The workstation backup to desktop and console backup are same :-)

After a number of late nights and multi plays..I now do an install and restore in this sequence

1. Install new instance of SME10, enable remote access, make sure all is running as should, toss a coin to do a yum backup...NOTE - did not do the restore from backup when offered do a reboot to make sure all is good :-)

2. Login and open the admin console..select restore from removable media - you know what happens here..

3. When its finished it offers the option to reboot..BEFORE doing that I open another terminal or use WinSCP - go into the custom templates and ditch or move any in httpd

4. Close those sessions or app and now do the reboot..

5.  I have had one issue only which I am now well aware of, for some reason after the restore my system swaps the eth card :-) so on restart cant get to it..two options using the local terminal screen if you do have access to the box its easy to just run configure from the console or visit the wild side and do the configure before the reboot after the restore..

All in all after about a dozen bare metal installs now to 2xHDs 2xSSD, 1xHD 1xSSD 1xSSD and 1xHD as data drive..been all good..my little HP Microserver is getting a bit long in the tooth so  two enterprise SSDs that I had purchased for sme10 ended up with ata errors issues dropping back to ata2, once sussed what was what got SSDs that did the deed and shes now running on a 500gb seagate barracuda for sme10 and a 1TB data drive
--
qui scribit bis legit

Online Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Restore data
« Reply #6 on: March 31, 2021, 06:24:05 AM »
here is my sequence


Local
  • install SME10 wait for the backup
  • backup SME9 using this https://wiki.contribs.org/Migratehelper
  • use the smeserver.tgz obtained from previous step to restore bare minimal
  • before reboot configure console so that my new hardware and my IP is ok for this new server
  • when up and running,, and have eventually switch SME9 to new IP rsync the remaining data to SME10



Remote
  • install SME10 using https://wiki.contribs.org/Centos2sme with a dedicated partition/dev/sda4  for future data and our currentbackup
  •   sshfs future SME1- /dev/sda4 to SME9 /mnt/backup
  • backup SME9 using this https://wiki.contribs.org/Migratehelper
  • use the smeserver.tgz obtained from previous step to restore bare minimal directly from the /dev/sda2
  • before reboot configure console so that my new hardware and my IP is ok for this new server
  • mount my /dev/sda4 to  /home/e-smith/files
  • when up and running rsync the remaining data to SME10

remaining data is mainly  /home/e-smith/files,shares and  backup I put in /home/e-smith/mysql*/*
if VM and lucky to have it on a dedicated virtual drive, just switch the data drive to new vm

Offline sages

  • *
  • 182
  • +0/-0
    • http://www.sages.com.au
Re: Restore data
« Reply #7 on: April 10, 2021, 02:48:00 AM »
Q. smeserver-migratehelper is in sme10 contribs, does this mean it is no longer possible to use it to migrate from sme9?
Or do we need to make the sme10 contribs visible to sme9 and/or do a direct download of the package into sme9 and then a file install on the sme9 box?
...

Online Jean-Philippe Pialasse

  • *
  • 2,747
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Restore data
« Reply #8 on: April 10, 2021, 05:30:56 AM »
Q. smeserver-migratehelper is in sme10 contribs, does this mean it is no longer possible to use it to migrate from sme9?
Or do we need to make the sme10 contribs visible to sme9 and/or do a direct download of the package into sme9 and then a file install on the sme9 box?

I suggest either the direct download of the rpm or easier directly from CVS:
Code: [Select]
wget https://viewvc.koozali.org/smecontribs/rpms/smeserver-migratehelper/contribs10/migratehelper.sh -O /usr/bin/migratehelper.sh
then review the script, fix the include path and exclude path to your need and run it


I have added some notes on the wiki https://wiki.koozali.org/Migratehelper
« Last Edit: April 10, 2021, 05:51:55 AM by Jean-Philippe Pialasse »

Offline TerryF

  • grumpy old man
  • *
  • 1,821
  • +6/-0
Re: Restore data
« Reply #9 on: April 10, 2021, 05:58:19 AM »
aha..that clarifies things, was wondering a little WTF :-)
--
qui scribit bis legit