Koozali.org: home of the SME Server

what does the SME restore from tape do

elenezet

what does the SME restore from tape do
« on: January 20, 2003, 07:19:34 PM »
All is in the subject... if someone know something about restore action. I try to know what sme do when retore action is select. How mysql dump table are restore ...

Thanks.
elenezet

Ray Mitchell

Re: what does the SME restore from tape do
« Reply #1 on: January 23, 2003, 06:47:05 AM »
Search these forums it has been answered a few months ago by me & others.
You can also look at e-smith.org, the answer is there.
Try
http://www.e-smith.org/bboard//read.php?v=t&f=3&i=23844&t=22780
Regards
Ray Mitchell

Ray Mitchell

Re: what does the SME restore from tape do
« Reply #2 on: January 23, 2003, 06:52:09 AM »
You will have to manually restore mysql and other files that are not automatically restored by the server manager restore function using the command line
Regards
Ray Mitchell

elenezet

Re: what does the SME restore from tape do
« Reply #3 on: January 23, 2003, 10:50:25 AM »
Hello,

Yes i do that. I don't find info about what is done when a restore from tape is done. I understand and know what files are restored but i don't know what a restore from backup do after to synchronise passwd, mysql, ldap, ssh, ....to restore mysql i do that:

etc/rc.d/init.d/mysqld stop
/etc/e-smith/events/actions/conf-mysql-password
/etc/rc.d/init.d/mysqld star
Then i use this one to restore table:
/etc/e-smith/events/action/mysql-import-table

 i have a working solution but i would like to know how sme did it in
normal situation ( with a tape backup and not a disk ).
Thanks.

Ray Mitchell

Re: what does the SME restore from tape do
« Reply #4 on: January 24, 2003, 07:29:31 AM »
The backup to tape will backup ALL filesystems.

The restore from tape only restores the files and directories in the list below.

If you wish to restore any other file(s) that have been backed up to tape you have have to do that manually using the flexbackup program command line commands.

Have a look at flexbackup for further info.

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

The backup to desktop will compress the above listed directories to a file named smeserver.tgz:

The restore from desktop will ONLY restore the files in the above list.

Regards
Ray Mitchell

Ray Mitchell

Re: what does the SME restore from tape do
« Reply #5 on: January 24, 2003, 09:45:50 AM »
Dear elenezet

This information was given to me by another sme user and may be useful to you. (Thanks to Graeme R).

First make a temporary restore directory where the restore file(s) will
go.  You will move them after the
restore to required ibay.  This is necessary as the restore re-creates the
original file structure as well as
restoring the file, which gets confusing for users.

mkdir /var/tmp/restore

Now change to that directory.  

cd /var/tmp/restore

Make sure the tape the files are on is inserted, then rewind the tape:

mt -f /dev/nst0 rewind

Now the tape has to be moved forward to where the file list can be read by
flexbackup:

mt -f /dev/nst0 fsf 1

flexbackup  -restore

This 'restore' options starts up an interactive menu which allows you to
navigate using the usual commands
through the filesystem stored on the tape.  When you locate the file(s)
you want to restore add them using
the add command.  Add as many files as you want.  

If you've done the above correctly you'll get something like the below
output.  Note you can type help to get
a list of the interactive commands.

[root@av#### /root]# flexbackup -restore

flexbackup version 0.9.8
/etc/flexbackup.conf syntax OK

|------------------------------------------------
| Reading from current tape position
|------------------------------------------------
At block 2.
|------------------------------------------------
| buffer -m 3m -s 10k -u 100 -t -p 75 -B -i /dev/nst0 | gzip -dq | restore
-i \
|  -v -b 10 -f -
|------------------------------------------------
Verify tape and initialize maps
Dump   date: Tue Feb  5 02:01:28 2002
Dumped from: the epxxx
Level 0 dump of / on avanti:/dev/hda6
Label: none
Extract directories from tape
Initialize symbol table.
restore > help
Available commands are:
        ls [arg] - list directory
        cd arg - change directory
        pwd - print current directory
        add [arg] - add arg' to list of files to be extracted
        delete [arg] - delete arg' from list of files to be extracted
        extract - extract requested files
        setmodes - set modes of requested directories
        quit - immediately exit program
        what - list dump header information
        verbose - toggle verbose flag (useful with ls'')
        prompt - toggle the prompt display
        help or ?' - print this list
If no arg' is supplied, the current directory is used
restore >

When you are ready and have added all the files you need restored issue
the 'restore' command.  When
the restore is done you'll be prompted to save the files with their
orgiinal permissions.  
Then moved the directories/files into the right place using mv.
eg.
mv /var/temp/restore/restored
/home/e-smith/files/ibays/data/files/originaldir

And finally, rewind and eject the tape:
 
mt -f /dev/nst0 rewoffl

Note:
- there is more than one way to restore a file (or do anything in linux
really).   Using the interactive restore is
slower but I believe much easier for a beginner. Or maybe not, it's just
what I got a handle on first.
- restoring can take a long time, even for a few files.
- if you want more information study the man file.

Regards
Ray Mitchell

elenezet

Re: what does the SME restore from tape do
« Reply #6 on: January 24, 2003, 11:19:52 AM »
Hello and thanks for this explication...but i feel as if i missed something in the restore opération.
I try to use the following how to ( i've no tape backup ) :
how to backup to disk using flexbackup on e-smith and how to restore individual files from disk using flexbackup on e-smith.

Then i have a working solution for backing up server on a remote disk but, i can restore individual files but  when i try to retore from a fresh install i feel as if there is an operation that i missed or i have a bad extract-list? I l try with you rmethode but i feel as if there is something else to do ... no? Did someone know how to use these how to to restore to a fresh install?
Thanks in advance.
elenezet

Ray Mitchell

Re: what does the SME restore from tape do
« Reply #7 on: January 24, 2003, 12:12:43 PM »
Dear elenezet

You say "but i feel as if i missed something in the restore opération"

You say "i can restore individual files but when i try to restore from a fresh install i feel as if there is an operation that i missed or i have a bad extract-list"

What is it that you missed ??
What do you actually mean, what error message do you get ??


If you use the standard backup to desktop in server manager, generally you would make a backup to desktop (workstation) file from your old sme system.
Then do a clean instal of sme on your new system
Then do a restore from desktop operation, this will only restore the files previously mentioned in a standard backup to desktop.
Then instal any extra rpms you previously installed on the old system that are not part of standard sme instal, these are not backed up in a backup to desktop.


If you use the flexbackup procedure to backup to desktop as outlined in the HOWTO's then this process is completely different to the above.
Follow the instructions in the HOWTO's for backing up and restoring.
I assume that this method backups ALL filesystems as it is emulating a tape backup but writing the files to a disk drive.
When restoring, the files to be restored are based on the contents of the extract-list. If this list is not correct then the files will not be restored.

What is the specific problem you are having ??

Regards
Ray Mitchell

elenezet

Re: what does the SME restore from tape do
« Reply #8 on: January 24, 2003, 12:39:27 PM »
Ok, i feel as if i found my error. I'll try to explain to you what i do.
I use the how to backup to disk using flexbackup to backup my sme server. OK it's work fine ;o)
Then i use "how to restore individual files from disk using flexbackup", i feel as if it work fine because i can restore files ;o)
Then i test it ...i backup my sme server ( sme 55 update 2).
Then i install a fresh sme server, update it with update2.... install script for backup/restore ... i create my extract-list. This is my extract-list:
/home/e-smith
/etc/e-smith/templates-custom
/etc/e-smith/templates-user-custom
/etc/ssh
/root/.ssh
/etc/passwd
/etc/shadow
/etc/group
/etc/gshadow
/etc/smbpasswd
In a first time i reboot after this step, now i make a /sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot
and it work fine ( restore sql base ....)
Then if i don't do the last command i don't have a working solution. May be the contributor will add this in his how to ;o)
... i was sure that i missed something. Could you confirm that it's a good procedure?
Thanks for all and for your help.
elenezet