Koozali.org: home of the SME Server

How can I restore a email folder (and its sub-folders)

Offline pearless

  • *
  • 38
  • +0/-0
How can I restore a email folder (and its sub-folders)
« on: December 24, 2009, 03:52:41 AM »
Hi Team,

Well I have accidentally deleted a mail folder and its sub-folders (IMAP) via Thunderbird.

These were backed up on tape & I have put the tape to one side so it won't be over written, but I cannot find out how to restore just that folder and its sub-folders.

Help!

Cheers
Douglas.

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I restore a email folder (and its sub-folders)
« Reply #1 on: December 24, 2009, 05:12:09 PM »
What are you using for backup?


Offline mmccarn

  • *
  • 2,657
  • +10/-0
Re: How can I restore a email folder (and its sub-folders)
« Reply #2 on: December 24, 2009, 05:33:11 PM »
You will probably need to tell us exactly how you created the tape at some point...

One idea that occurs to me is (assuming you have a spare computer on hand):
- restore the tape to a different computer
- copy the missing email folder onto the production server
- correct the permissions on the restored email folder (if necessary)

Here are some notes from an old post about restoring a missing email from a USB HDD backup: http://forums.contribs.org/index.php/topic,34850.msg195291.html#msg195291

I think that the default SME tape backups use "flexbackup"; if so, the following links may help you with selective restores:
http://www.edwinh.org/flexbackup/faq.html#Recovery%20/%20Extraction0
http://www.minihowto.org/flexbackup_howto/flexbackup%20a%20simple%20backup%20program.html

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: How can I restore a email folder (and its sub-folders)
« Reply #3 on: December 24, 2009, 07:29:04 PM »
I think that the default SME tape backups use "flexbackup"; if so, the following links may help you with selective restores:
http://www.edwinh.org/flexbackup/faq.html#Recovery%20/%20Extraction0
http://www.minihowto.org/flexbackup_howto/flexbackup%20a%20simple%20backup%20program.html

Somebody should post similar (but SME server specific) information to our wiki. I'm sure that selective restore instruction appear here somewhere already.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: How can I restore a email folder (and its sub-folders)
« Reply #4 on: December 25, 2009, 01:36:48 AM »
there is something in Sonoracomm's
site

Offline pearless

  • *
  • 38
  • +0/-0
Re: How can I restore a email folder (and its sub-folders)
« Reply #5 on: December 25, 2009, 03:03:23 AM »
It seems the easiest way will be to es VMWARE to create a virtual SMEServer, restore from tape, change it's IP address (so the two servers are on different IP addresses), then add the old email account to Thunderbird  and drag and drop the lost folders from the old email account to the new one.

I tried using flexbackup to restore the old files, it got too complicated too quickly!

Thanks for all the pointers, it seems there is a big gap in SMEServer that manages restoration of lost files, emails etc.

Cheers
Douglas

Offline mercyh

  • *
  • 824
  • +0/-0
    • http://mercyh.org
Re: How can I restore a email folder (and its sub-folders)
« Reply #6 on: December 25, 2009, 03:34:48 AM »
I don't know about flexbackup but DAR does it easily. (I don't think DAR can manage tapes though)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: How can I restore a email folder (and its sub-folders)
« Reply #7 on: December 25, 2009, 04:59:26 AM »
pearless & all

Here is a draft howto from many years ago. I imagine the steps are still applicable, perhaps someone with a tape drive could check. I don't use tape anymore.

First make a temporary restore directory where the restore file(s) will
go.  
They will be moved them after the restore to required final location.  
This is necessary as the restore re-creates the
original file structure as well as restoring the file.

mkdir /var/tmp/restore

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 output below.  
Note you can type help to get a list of the interactive commands.

flexbackup -restore

flexbackup version 0.9.8 <flexbackup@home.com>
/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 xxxxx
Level 0 dump of / on server:/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 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
original permissions.  
Then move the directories/files into their final location using mv
eg
mv /var/temp/restore/restored
/home/e-smith/files/users/username/MailDir

When finished rewind and eject the tape

mt -f /dev/nst0 rewoffl

Notes:
- there is more than one way to restore a file (or do anything in Linux
for that matter).   Using the interactive restore is
slower but usually easier for a beginner. 
- restoring can take a long time, even for a few files.
- for more information read the man file ie
man flexbackup
or Google flexbackup
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.