Backup/Restore Scripts - updated with restore script

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

nader
Posts: 27
Joined: Thu Dec 22, 2005 6:17 pm

Postby nader » Mon Apr 03, 2006 12:36 pm

Yes, I am running the scripts as root. One thing that I didn't mention earlier was that I am running my/your script using ncpfs (novelclient) to a novell server....

I'm trying to install the netware version of rsync on the server. and I'll see if I have better success that way.

Kind Regards,

Nader.

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Tue Apr 04, 2006 12:11 pm

Maybe I need to read the official docs some more, and if that's the case please point me to the proper docs, but some things aren't clear to me:

1) How do I go about getting access to that mailbox as the user needing to retrieve something?
2) Are permissions already in place to allow them (and only them) to open the mailbox from Outlook?
3 Can they even get to it in SWA?

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Tue Apr 04, 2006 7:06 pm

OK scratch my above questions.
I read the Tech note about "Corruption/Recovery, ISDB and SUR"

There are three options in that doc for accessing the restored mailbox. Is there no way to use Outlook's "Open another user's folder" functionality to access the mailbox on the restore node?

I've configured the backup script and used it to retrieve a backup for account "Tommy Tester". It created and populated:

Code: Select all

'Tommy Tester /restore,mydomain/CN=Tommy Tester'
  InTray: 5 messages
  OutTray: 0 messages
  Folder 'Search Area': 0 items
  Folder 'Calendar': 0 items
  Folder 'Contacts': 0 items
  Folder 'Drafts': 0 items
  Folder 'Notes': 0 items
  Folder 'Tasks': 0 items
  Tracking Area: 0 messages
  List Area: 0 messages
  Waste Basket: 0 items


As far as using some other IMAP client to access the mailbox, how do you differentiate between the original user and the restore user? Do you supply the username in the form ttester@restore.mydomain or what?

There has to be a simpler way to accomplish this...

florian
Scalix
Scalix
Posts: 3852
Joined: Fri Dec 24, 2004 8:16 am
Location: Frankfurt, Germany
Contact:

Postby florian » Tue Apr 04, 2006 8:07 pm

Hi,

at this point, to be able to use "Open Other users folder" you will have to have delegate access on the mailbox. to assign those permissions, you'll have to login to the account first.

You can use the internet address or the authentication id (which must both be unique) to login through both outlook and imap.

understand that this is not the most convenient way to do things. we're working on adding to the backup and restore options available in the next major scalix release. wait for some pretty exciting announcements this coming summer.......

cheers,
Florian.
Florian von Kurnatowski, Die Harder!

marijnvanbutselaar
Posts: 17
Joined: Wed Feb 15, 2006 9:14 am

Postby marijnvanbutselaar » Wed Apr 05, 2006 9:17 am

Am I missing something, or what. I created a backup with the ombackup command, witch was successful.
Then I did omrestore -u "sxadmin" -f "/backup/users/<MAILNODE>/sxadmin-<DATE>-mail.gz" and got a "Error: Failed to load mailbox data from <ABOVE FILENAME>. There may be more information available in the logfile at <LOGFILE>"
Then I manually gunziped the <datafile.gz>, and used that instead. This worked file.

So, modified the restore script to do this for me, maybe you could include it:

Code: Select all

RESTORE_FILE_EXT=`expr match "$RESTORE_FILE" ".*\.gz"`
if [ "$RESTORE_FILE_EXT" != 0 ]
then
    echo_and_log "Specified data file is a gz file, extracting"
    gzip -cd "$RESTORE_FILE" > "${BACKUP_DIR}/tmprestorefile"
    RESTORE_FILE="${BACKUP_DIR}/tmprestorefile"
fi

$SCALIX_BIN/omcpinu -f $RESTORE_FILE -m $RESTORE_MN >>$LOGFILE
if [ "$?" != "0" ]
then
    exit_with_error "Failed to load mailbox data from $RESTORE_FILE. There may be more information available in the logfile at $LOGFILE"
else
    echo_and_log "Finished loading mailbox data from $RESTORE_FILE"
fi


if [ -f "${BACKUP_DIR}/tmprestorefile" ]
then
    echo_and_log "Removing tmp extracted datafile"
    rm "${BACKUP_DIR}/tmprestorefile"
fi


An other way of doing this could be done with a zcat pipe like (BUT CAN'T GET IT TO WORK, missing something there):

Code: Select all

RESTORE_FILE_EXT=`expr match "$RESTORE_FILE" ".*\.gz"`
if [ "$RESTORE_FILE_EXT" != 0 ]
then
    zcat $RESTORE_FILE | $SCALIX_BIN/omcpinu -f - -m $RESTORE_MN >>$LOGFILE
else
    $SCALIX_BIN/omcpinu -f $RESTORE_FILE -m $RESTORE_MN >>$LOGFILE
fi
if [ "$?" != "0" ]
then
    exit_with_error "Failed to load mailbox data from $RESTORE_FILE. There may be more information available in the logfile at $LOGFILE"
else
    echo_and_log "Finished loading mailbox data from $RESTORE_FILE"
fi

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Wed Apr 05, 2006 10:54 am

marijnvanbutselaar wrote:Am I missing something, or what. I created a backup with the ombackup command, witch was successful.
Then I did omrestore -u "sxadmin" -f "/backup/users/<MAILNODE>/sxadmin-<DATE>-mail.gz" and got a "Error: Failed to load mailbox data from <ABOVE FILENAME>. There may be more information available in the logfile at <LOGFILE>"
Then I manually gunziped the <datafile.gz>, and used that instead. This worked file.

So, modified the restore script to do this for me, maybe you could include it:

Code: Select all

RESTORE_FILE_EXT=`expr match "$RESTORE_FILE" ".*\.gz"`
if [ "$RESTORE_FILE_EXT" != 0 ]
then
    echo_and_log "Specified data file is a gz file, extracting"
    gzip -cd "$RESTORE_FILE" > "${BACKUP_DIR}/tmprestorefile"
    RESTORE_FILE="${BACKUP_DIR}/tmprestorefile"
fi

$SCALIX_BIN/omcpinu -f $RESTORE_FILE -m $RESTORE_MN >>$LOGFILE
if [ "$?" != "0" ]
then
    exit_with_error "Failed to load mailbox data from $RESTORE_FILE. There may be more information available in the logfile at $LOGFILE"
else
    echo_and_log "Finished loading mailbox data from $RESTORE_FILE"
fi


if [ -f "${BACKUP_DIR}/tmprestorefile" ]
then
    echo_and_log "Removing tmp extracted datafile"
    rm "${BACKUP_DIR}/tmprestorefile"
fi


An other way of doing this could be done with a zcat pipe like (BUT CAN'T GET IT TO WORK, missing something there):

Code: Select all

RESTORE_FILE_EXT=`expr match "$RESTORE_FILE" ".*\.gz"`
if [ "$RESTORE_FILE_EXT" != 0 ]
then
    zcat $RESTORE_FILE | $SCALIX_BIN/omcpinu -f - -m $RESTORE_MN >>$LOGFILE
else
    $SCALIX_BIN/omcpinu -f $RESTORE_FILE -m $RESTORE_MN >>$LOGFILE
fi
if [ "$?" != "0" ]
then
    exit_with_error "Failed to load mailbox data from $RESTORE_FILE. There may be more information available in the logfile at $LOGFILE"
else
    echo_and_log "Finished loading mailbox data from $RESTORE_FILE"
fi


Are you really trying to restore the sxadmin user mailbox? I ,too, gunzipped the mailbox archive before running omrestore, and then it was successful.
Last edited by cdclark on Wed Apr 05, 2006 11:02 am, edited 1 time in total.

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Wed Apr 05, 2006 10:57 am

florian wrote:Hi,

at this point, to be able to use "Open Other users folder" you will have to have delegate access on the mailbox. to assign those permissions, you'll have to login to the account first.

You can use the internet address or the authentication id (which must both be unique) to login through both outlook and imap.

understand that this is not the most convenient way to do things. we're working on adding to the backup and restore options available in the next major scalix release. wait for some pretty exciting announcements this coming summer.......

cheers,
Florian.


Actually that's quite helpful. I'd rather take the step of setting the permissions than expect the end user to configure a secondary profile or imap client. What is the syntax for opening a mailbox on another mailnode within Outlook's dialog box? I would presume its something like Tommy Tester/restore,mydomain or something like that?

ja30278

Postby ja30278 » Wed Apr 05, 2006 11:05 am

Are you really trying to restore the sxadmin user mailbox? Also, I gunzipped the mailbox archive before running omrestore, and then it was successful.


Yea. I actually considered building in the unzipping functionality as marijnvanbutselaar has done above, but in then end just decided to unzip it myself. I actually hesitated to include the zipping fucntionality in the backup script; it seems cleaner to just dump the files 'raw', then handle compression as a cron job.

To be honest, I'm actually thinking of scrapping the migration altogether, so I may not be making any further updates to my scripts.

RickC
Posts: 194
Joined: Tue Nov 16, 2004 12:55 pm
Location: Massachusetts USA
Contact:

Postby RickC » Wed Apr 05, 2006 11:09 am

Very nice thread -

Not to hijack it, but I wonder if anyone's tried the new 3rd party backup opton - http://www.sep.de/home_us.php.

If so, can you post any feedback?

Thanks.

marijnvanbutselaar
Posts: 17
Joined: Wed Feb 15, 2006 9:14 am

Postby marijnvanbutselaar » Wed Apr 05, 2006 11:19 am

cdclark wrote:Are you really trying to restore the sxadmin user mailbox? I ,too, gunzipped the mailbox archive before running omrestore, and then it was successful.


Well, of course it was just on my test server to try things out, tried it with other users too.

Not doing this stuff in production (yet).

Think I will just implement a basic backup scheme (tar.gz the /var/opt/scalix) for crashes only. Don't think I will bother with Single User/File restore anymore... To much work to get it up and running, and don't like the idea of having to create a restore mailnode for it. (And SUR, ISS, etc. are a bit of a pain too to implement)

Will wait until the summer release then... ;-)

Question:
Is a tar.gz of the /var/opt/scalix all you need for a full system backup??

Thanks,
Marijn van Butselaar.

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Wed Apr 05, 2006 11:29 am

marijnvanbutselaar wrote:Think I will just implement a basic backup scheme (tar.gz the /var/opt/scalix) for crashes only. Don't think I will bother with Single User/File restore anymore... To much work to get it up and running, and don't like the idea of having to create a restore mailnode for it. (And SUR, ISS, etc. are a bit of a pain too to implement)

Will wait until the summer release then... ;-)


I feel the same way, but in terms of long-term archival (such as when an important employee is terminated or leaves) I'd like to be prepared to dig into their archive in the future in the event of litigation. In that case, setting up a whole second server and bringing online a full backup would be extremely painful.

Question:
Is a tar.gz of the /var/opt/scalix all you need for a full system backup??


It would seem so. Such an archive would contain not only the mailstore but the executables and the configs.

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Wed Apr 05, 2006 11:35 am

ja30278 wrote:To be honest, I'm actually thinking of scrapping the migration altogether, so I may not be making any further updates to my scripts.


That would be unfortunate. I really appreciate the work you've put in.
As for my migration, I'm holding off until at least the next release for a few reasons:

-Clumsy backups/restores
-Inability to desktop sync with a modern blackberry (and crazy prizing from Notify link). Bring on the funambol!
-some other issues I can't recall at the moment

On the flip side, I'm pleased with the new small business pricing announced this week.

In the meantime I'll continue to use CE for myself and a few key players in the company, and use the opportunity to really learn the product on this release before moving on to the next.

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Wed Apr 05, 2006 11:52 am

florian wrote:Hi,

at this point, to be able to use "Open Other users folder" you will have to have delegate access on the mailbox. to assign those permissions, you'll have to login to the account first.
cheers,
Florian.


Florian,

Pursuing this path... I went ahead and made the restore user a premium account using ommodu (this account doesn't appear in SAC). I set delegation within outlook. I still can't figure out the syntax to point the client to this "restore-user" mailbox. The restore account doesn't appear in the directory because they were created with omaddu -x. So I can't just click on them in the directory... any hints?

ja30278

Postby ja30278 » Wed Apr 05, 2006 4:25 pm

That would be unfortunate. I really appreciate the work you've put in.
As for my migration, I'm holding off until at least the next release for a few reasons:

-Clumsy backups/restores
-Inability to desktop sync with a modern blackberry (and crazy prizing from Notify link). Bring on the funambol!
-some other issues I can't recall at the moment

On the flip side, I'm pleased with the new small business pricing announced this week.

In the meantime I'll continue to use CE for myself and a few key players in the company, and use the opportunity to really learn the product on this release before moving on to the next.



It _IS_ unfortunate. I've spent years watching the groupware space, waiting for a viable linux solution. I definitely don't want to speak negatively about Scalix as a product, because it's very good software, and it's _almost_ there; but there are several deal killers that make it increasingly obvious that I can't roll it into production.

Anybody have any idea about the return poilcy? Or, at the very least, is the license transferrable?

cdclark
Posts: 73
Joined: Tue Mar 07, 2006 2:20 pm

Postby cdclark » Fri Apr 07, 2006 10:41 am

I'm bumping this thread to call attention to my last question (2 posts up!)


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 11 guests