Page 24 of 66 FirstFirst ... 14222324252634 ... LastLast
Results 231 to 240 of 659

Thread: [SOLVED] Yet Another Backup Script for Community Version

  1. #231
    hamzy is offline New Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    5

    Default Restore

    Hello, I apologize for my English. Indeed I am French. The script works perfectly.
    How do you restore?

    Best regards,

    Guillaume P.

  2. #232
    Fooshnik is offline Member
    Join Date
    Dec 2009
    Posts
    12
    Rep Power
    5

    Default

    I would like to know how to restore as well.

  3. #233
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Either
    a) Quit Zimbra, if running.
    Move the current Zimbra directory, if it exists, to a different path, e.g. /opt/zimbra.old.
    Copy or move the SYNC_DIR directory, from the script, back to the ZM_HOME location, usually /opt/zimbra.
    Start Zimbra.
    If you have lost any mail, you can reinject it through Zimbra commands.
    OR
    b) Same as above, except instead of using the SYNC_DIR, restore the .dar files.
    For example,
    /etc/init.d/zimbra stop (or /opt/zimbra/zmcontrol stop as Zimbra user)
    mv /opt/zimbra /opt/zimbra.old
    mkdir /opt/zimbra
    cd /opt/zimbra
    dar -x /backup/current/ZimbraBackup_16-February-2010_FULL
    dar -x /backup/current/ZimbraBackup_17-February-2010_DIFF
    dar -x /backup/current/ZimbraBackup_18-February-2010_DIFF
    /etc/init.d/zimbra start


    Which one you do would depend on the nature of the problem.
    I haven't actually ever had to restore, so this is just an outline of general steps.
    More explicit restore instructions would be a nice thing to include with the script.

  4. #234
    hamzy is offline New Member
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    5

    Default Restore a single user account

    Thank you for your prompt response. I used the solution B and the restoration went well.

    Is it possible to restore a single user account?

    Thank you again

    Best regards,

    Guillaume P.
    Last edited by hamzy; 02-19-2010 at 02:24 AM.

  5. #235
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    These instructions have been superseded by [SOLVED] Yet Another Backup Script for Community Version
    ---------------------------------------------

    • I have not tried this. Use at your own risk.
    • I've adjusted this post to be more general. The person who actually restores a user successfully should hopefully take the time to be more specific.
    • I make no attempt to backup and restore LDAP attributes. This may be possible with slapcat and ldapadd.


    1) Make sure you have a good backup.

    2a) If the user already exists, ascertain their current mailboxId:
    Code:
    [zimbra@mail bin]# zmprov getMailboxInfo user@domain.com
    
    mailboxId: 8
    quotaUsed: 12350
    2b) If the user does not exist, you have to look in the backup of the message store to find the user's folder, e.g. /backup/sync/store/0/. Each of the numbered folders in there will be a mailboxId, i.e. individual user store. Using grep or other means, find the folder of the desired user.

    3) Backup the existing database for the user if it exists (in /opt/zimbra/db/data/mboxgroup#).

    4) Backup the user's store, /opt/zimbra/store/0/#, which will contain new messages, etc. since the last backup.

    5) Add the user, if they don't exist.

    6) Recreate the user's database from backup. You can do this either by stopping Zimbra, and replacing the existing database for the user with a same-named backup, or by importing a .sql dump backup.

    7) Recreate the user's mailbox and mailbox_metadata entry in the zimbra db.

    8) Restore the user's old store.

    9) If desired, import the user's messages which arrived since the last backup (if you have them). It's probably easiest to just make a new folder for the user, then import all of their newer store into it. You'll want to add X-Zimbra-Received to each message before importing. The user can then just sort by date, and delete all of the old messages at once.

    I posted more about importing and db restore here.


    This guy made a python script to SQL dump the data store, Per User Mailbox Backup (OE Version) - Zimbra :: Wiki I have not tried it. It looks good though, so I am going to integrate this into my backup routine. This script gets both the user's database, and their entries in the zimbra mailbox and mailbox_metadata tables.
    If it worked, it could be run with along side the main script to simplify individual user restores. Since it directly modifies the backend db, it would be wise to run it on a test install first. I'll repost if I get it working.


    Considering the steps involved, the Network Edition is very attractive.
    Last edited by LaFong; 04-07-2011 at 03:31 PM.

  6. #236
    MoreDakka is offline Active Member
    Join Date
    Apr 2009
    Posts
    25
    Rep Power
    6

    Default

    I'm guessing no one has seen the problem I posted since it's on the page before this one: [SOLVED] Yet Another Backup Script for Community Version Hoping someone can help with this. I'm using another script that isn't as nice to get the job done until I can configure this one properly.

    Thanks.

  7. #237
    liverpoolfcfan's Avatar
    liverpoolfcfan is offline Outstanding Member
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    6

    Default

    Quote Originally Posted by MoreDakka View Post

    SNIP

    Saving Unencrtyped Archive...
    nice: invalid option -- s
    Try `nice --help' for more information.
    Dar had a problem!
    Null message body; hope that's ok
    [root@testzimbra backup]#

    Don't know what to do with that "nice: invalid option -- s"
    Any ideas?
    Thanks.
    I believe your issue is you do not have the dar binary on your system - hence the script thinks the -s option is supposed to go with the nice command - instead of the dar command.

    The line in the script is ...

    Code:
    nice -19 $DAR_BIN -s $ARCHIVESIZE -z$COMPRESS -Z "*.gz" -Z "*.zip"\
    		    -Z "*.bz2" -Z "*.tgz" -Z "*.zgz" -Z "*.jar" -Z "*.tiff" \
    		    -Z "*.jpg" -Z "*.png" -Z "*.gif" -Z "*.jpeg" -R `pwd` \
    		    -c "$ARCHIVEDIR""$ARCHIVENAME" -Q
    and if the script variable $DAR_BIN (location of the dar binary) is null - then instead of running

    nice -19 /usr/bin/dar -s ......

    it runs

    nice -19 -s ......

    You need to download the dar binary for your linux release - or download source and compile.

    See DAR - Disk ARchive for details.

    You can also check your distribution to see if there is a pre-built package available.

  8. #238
    dillweed is offline Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    5

    Default

    Hi,

    We are using the Zimbra community edition in a small business and really think it is swell. Since the community edition does not have built in backup we are evaluating various backup options and have given this script a try. It seems to work...mostly. The problem doesn't seem to be with the script, but the fact that when zimbra is shutting down it throws an error. After the error is given the script stops and zimbra does not come back up. I'd rather lose a backup than have zimbra down for a whole night.

    Here is the error we are getting and it is completely random. Sometimes it works flawlessly and then at other times it doesn't work.
    Code:
    ============================
    Sun Feb 21 22:00:02 PST 2010
    Performing DIFF backup
    ============================
    diff Backup started at: Sun Feb 21 22:00:02 PST 2010
    Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
    Doing a hotsync of /opt/zimbra/ to /home/zimbackup/fakebackup/
    Disabling the Zimbra crontab...
    Stopping the Zimbra server...
    
    Host *****.****.****
            Stopping stats...Done.
            Stopping mta...Done.
            Stopping spell...Done.
            Stopping snmp...Done.
            Stopping archiving...Done.
            Stopping antivirus...Failed.
    Stopping freshclam...done.
    Stopping clamd...failed.
    
    
            Stopping antispam...Done.
            Stopping imapproxy...Done.
            Stopping memcached...Done.
            Stopping mailbox...Done.
            Stopping logger...Done.
            Stopping ldap...Done.
    zmcontrol shutdown had an error!
    Is there a way to have the script check for errors and then respond according? For example, have the script restart zimbra and then shutdown again if an error is given.

    Anyways, not to rag on the script, it's awesome that the author has taken the time to give back to the community. We really appreciate it, but at the same time we are hoping this feedback is a way to improve it too.

    Thanks

  9. #239
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Look in /var/log/messages at the entries around the time the script runs, assuming that's your syslog. Also look in /opt/zimbra/log/clamd.log. Make sure clamd starts up in the first place:
    Code:
    [root@mail log]# ps -ef | grep clamd
    zimbra   17153     1  0 03:11 ?        00:00:28 /opt/zimbra/clamav/sbin/clamd --config-file=/opt/zimbra/conf/clamd.conf
    If it never starts in the first place, it will fail when trying to stop it.

  10. #240
    dillweed is offline Junior Member
    Join Date
    Feb 2010
    Posts
    9
    Rep Power
    5

    Default

    Thanks for the help. Looking through the logs nothing seems to stand out. Everything is shutdown correctly. Here is another bit of the log from the next day. It looks like errors are coming from different directions. I don't think this is normal, but I also think that the person who set up the system (not me) didn't do it right.
    Code:
    ============================
    Sat Feb 20 22:00:02 PST 2010
    Performing DIFF backup
    ============================
    diff Backup started at: Sat Feb 20 22:00:02 PST 2010
    Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
    Doing a hotsync of /opt/zimbra/ to /home/zimbackup/fakebackup/
    Disabling the Zimbra crontab...
    Stopping the Zimbra server...
    
    Host *.*.*
    	Stopping stats...Done.
    	Stopping mta...Done.
    	Stopping spell...Done.
    	Stopping snmp...Done.
    	Stopping archiving...Done.
    	Stopping antivirus...Done.
    	Stopping antispam...Done.
    	Stopping imapproxy...Done.
    	Stopping memcached...Done.
    	Stopping mailbox...Done.
    	Stopping logger...Done.
    	Stopping ldap...Done.
    Doing a fast cold sync...
    Reinstating Zimbra's crontab...
    Starting Zimbra...
    Host mailserver.chs.home
    	Starting ldap...Done.
    	Starting logger...Done.
    	Starting mailbox...Done.
    	Starting antispam...Done.
    	Starting antivirus...Failed.
    Starting zmmtaconfig...zmmtaconfig is already running.
    Starting amavisd...amavisd is already running.
    Starting freshclam...done.
    Starting clamd...failed.
    
    
    	Starting snmp...Done.
    	Starting spell...Done.
    	Starting mta...Done.
    	Starting stats...Done.
    There was an error starting Zimbra!
    But any pointers into the direction to fix this would be great.
    Thanks
    Last edited by dillweed; 02-25-2010 at 09:08 AM.

Page 24 of 66 FirstFirst ... 14222324252634 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  2. Debian - Upgrade from 4.5.6
    By magikman in forum Installation
    Replies: 1
    Last Post: 01-19-2008, 12:59 PM
  3. Backup script issues
    By SSS in forum Administrators
    Replies: 18
    Last Post: 12-03-2007, 09:56 AM
  4. 4.0.4 to 4.5.6 upgrade failed in network edition
    By chenthil in forum Administrators
    Replies: 1
    Last Post: 08-27-2007, 09:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 09:36 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
  •