Results 1 to 3 of 3

Thread: zmrestore query

  1. #1
    padraig's Avatar
    padraig is offline Elite Member
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Question zmrestore query

    if i restore a users ac using:

    zmrestore -c -lb full-20071107.211158.xxx -a user@mydomain.com
    as per CLI zmrestore Network Edition only - Zimbra :: Wiki
    will this keep existing e-mail (using redo logs?) or will the user account be restored to the status in the backup minus new e-mails since the backup.

  2. #2
    kirme3 is offline Trained Alumni
    Join Date
    Apr 2006
    Location
    Illinois
    Posts
    194
    Rep Power
    9

    Default

    I believe the restore goes to only where the account was at that point in time. Any new messages are lost...someone correct me if I'm wrong.

    I usually restore to a new account and imapsync the missing message(s) to the users account. I then delete the restored account.

  3. #3
    padraig's Avatar
    padraig is offline Elite Member
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Thumbs up Quick & dirty restore/imapsync script

    thanks kirme3
    did a quick (&dirty) script to do this.
    nb: we need to use the an existing ldap ac( temp_restore which the restored_ac is renamed to ) for the imapsync because
    we use external ldap auth.

    HTH.

    Code:
    ###########################################################
    #   By Padraig nov 2007
    #
    # This Script is used to restore an existings uses account 
    # from a (full) backup and append the mailbox messages 
    # to the existing mailbox.
    # NB: this requires imapsync pre-installed
    # and "Enable clear text login"
    ###########################################################
    
    ###########################################################
    # required variables
    ###########################################################
    export DOMAIN='@mydomain.com'
    
    export FROM_AC=temp_restore$DOMAIN
    export FROM_PASS=temppass
    export FROM=`hostname`
    export TO=`hostname`
    
    clear
    echo -n "Please Input user ID: "
    read ID_NO
    
    echo -n "Please Input user PASS: "
    read -s PASS
    echo -e " \n"
    
    
    echo -e "valid Labes are: \n"
    su - zimbra -c 'zmrestoreldap -lbs' | grep full
    echo -e " \n"
    echo -n "Please Input the backup (dates) LABEL: "
    read LABEL
    
    export TO_ACCOUNT=$ID_NO$DOMAIN
    
    echo Processing $TO_ACCOUNT ... 
    echo -e \\n Please Wait ... 
    
    ###########################################################
    # backup the user just in case
    ###########################################################
    su - zimbra -c 'zmbackup -f -sync -a '$TO_ACCOUNT''
    
    ###########################################################
    # restore the account from the specified date
    # to another account prefioxed with restored_ ...
    ###########################################################
    su - zimbra -c 'zmrestore  -c -br -lb '$LABEL' -a '$TO_ACCOUNT' -ca -pre restored_'
    
    ###########################################################
    # remove the tmp restore ac
    ###########################################################
    su - zimbra -c 'zmprov da '$FROM_AC''
    
    ###########################################################
    # rename the new restored_ ac to be zrestore. Required for external LDAP auth.
    ###########################################################
    su - zimbra -c 'zmprov ra restored_'$TO_ACCOUNT' '$FROM_AC''
    
    ###########################################################
    # do the imapsync copy
    ###########################################################
    export SKIPHEAD="'^X-|^Status|^Bcc'"  # set the imapsync string "'^X-|^Status|^Bcc'"
    imapsync --timeout 30 --nosyncacls --syncinternaldates --host1 $FROM --user1 $FROM_AC --password1 $FROM_PASS --host2 $TO --user2 $TO_ACCOUNT --password2 $PASS --exclude junk --exclude Junk --exclude Trash --exclude trash --split1 500 --split2 500 --skipheader $SKIPHEAD | grep -i total

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Disaster Recovery SPAM query
    By padraig in forum Administrators
    Replies: 0
    Last Post: 10-30-2007, 08:33 AM
  2. zmrestore restoreToTime problem
    By magsuser2007 in forum Administrators
    Replies: 5
    Last Post: 10-15-2007, 01:41 PM
  3. Change the default mail sync query to a phone
    By phingers in forum Zimbra Mobile
    Replies: 1
    Last Post: 07-31-2007, 08:46 PM
  4. REST query should work, but doesn't
    By DrXero in forum Developers
    Replies: 4
    Last Post: 06-11-2007, 04:15 PM
  5. Lotus migration
    By babou in forum Migration
    Replies: 15
    Last Post: 03-05-2007, 10:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •