Professional Documents
Culture Documents
Search
BackingupandrestoringZimbra(OpenSourceVersion)
FromZimbra::Wiki
Thisarticleisacommunitycontributionandmayincludeunsupportedcustomizationsfornetworkeditioncustomers.
Ifyouwishtohaveamoreautomatedbackupfeature,youshouldtrythe[NetworkVersionofZimbra.]
Contents
1PreparingtoBackUp 2MakingaBackup 3Restoring 4Anotheroption
PreparingtoBackUp
Beforewebegin,makesurethatyouareloggedinasauserthatcanperformthetasksoutlinedhere. ItisalwaysgoodpracticetobackupyourcopyofZimbraintheeventofunforeseencircumstances. TopreventchangestoanyZimbradatabasesduringthebackupprocessesyoumaywishtouse: >suzimbra >zmcontrolstop toterminateZimbra. Ifyougetsomekindoferror,youmaywanttomakesurethatZimbrahascompletelystoppedbyrunning: >psauxww|grepzimbra andkillanyleftoverprocessessuchasthelog.
MakingaBackup
Restoring
Beforerestoring,youshouldmakesurethatalloftheprocessesassociatedwiththedamaged/failedZimbrainstallationareterminated.Failureto terminatealloftheprocessescouldhavedireconsequences.See"PreparingtoBackup"foradditionalinfo. 1)Renameyour"broken"Zimbrainstallation. Youmaybeabletoscavengedata,ifneeded.Ifyousimplydonotwanttheolddata,youcanskipthispart.Thisishowyoudoit: >mv/opt/zimbra/opt/zimbra_broken Youmaywanttomoveitcompletlyoutofthe/optfolderjusttobesafe.Afterthat,copyyourbackupZimbrainstallationtothe/optfolderandnameit "zimbra"byusingthefollowingcommands: >cprp[locationofbackup]/zimbra_backup/opt >mv/opt/zimbra_backup/opt/zimbra
Reviewtheoutputandthereshouldbeanentrynearthebottomthatwillshowthelastupgrade/installyoudid.Itlookssomethinglikethis:
1 2 0 3 1 0 6 1 0 2 : 1 2 0 3 1 0 6 1 2 4 : 1 2 0 3 1 0 6 1 2 6 : 1 2 0 3 1 0 6 1 3 4 : 1 2 0 3 1 0 6 1 5 0 : 1 2 0 3 1 0 6 1 5 4 : 1 2 0 3 1 0 6 1 6 7 : 1 2 0 3 1 0 6 1 7 1 : 1 2 0 3 1 0 6 1 7 3 : 1 2 0 3 1 0 6 1 7 3 : I N S T A L LS E S S I O NS T A R T U P G R A D E Dz i m b r a c o r e 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a l d a p 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a l o g g e r 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a m t a 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a s n m p 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a s t o r e 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a a p a c h e 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m U P G R A D E Dz i m b r a s p e l l 4 . 5 . 1 1 _ G A _ 1 7 5 1 . R H E L 4 2 0 0 8 0 1 2 8 1 3 0 5 1 5 . i 3 8 6 . r p m I N S T A L LS E S S I O NC O M P L E T E
Fornonrpminstallationsyoumightsee.debinsteadof.rpmbutthisshouldworkonallplatforms.
Ifallgoeswell,youwillseethefollowing: TheZimbraCollaborationSuiteappearsalreadytobeinstalled. Itcanbeupgradedwithnoeffectonexistingaccounts, orthecurrentinstallationcanbecompletelyremovedprior toinstallationforacleaninstall. Doyouwishtoupgrade?[Y] ChooseY. Thescriptwillremovetheexistingpackages,andinstallthemagain.ThescriptwillattempttostopZimbraServicesand"UPGRADEFAILED exiting".Thisisokay,simplyrerunthescript,anditwillinstallnormally. Ifyouexperienceerror389,1,connectionrefusederrors,pleasesearchtheForums.Theseerrorsarecoveredextensively. 4)Resetpermissions Ifyouareupandrunningnow,youmayhaveonemorehurdletoovercome:permissions. Youmayneedtoresetthepermissionsonthemessagestorebyrunningthefollowing: >chownRzimbra:zimbra/opt/zimbra/store >chownRzimbra.zimbra/opt/zimbra/index Alsoasrootrunthefollowing:
/ o p t / z i m b r a / l i b e x e c / z m f i x p e r m s
Somescriptscanbefoundhere:http://wiki.zimbra.com/index.php?title=Open_Source_Edition_Backup_Procedure
Anotheroption
ZimbraBackupandRestore"hot".[ByRichardsonLimahttp://br.linkedin.com/in/richardsonlima] BACKUP
*S c r i p t1 *T h i ss c r i p tm u s tb er u na sr o o t ,i tr u n st h es c r i p tr u n B a c k u p A l l . s ha n da l s os e n d st h ee n t i r eb a c k u pt oas e c o n dm a c h i n e .
e c h o" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " e c h o" * Z i m b r a-B a c k u pa l le m a i la c c o u n t s * " e c h o" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " e c h o " " # e c h oS t a r tt i m eo ft h eb a c k u p=$ ( d a t e+ % T ) b e f o r e = " $ ( d a t e+ % s ) " #
e c h o" " Z H O M E = / o p t / z i m b r a Z B A C K U P = $ Z H O M E / b a c k u p / m a i l b o x e c h o" G e n e r a t i n gb a c k u pf i l e s. . . " s u-z i m b r ac" / o p t / b a c k u p / S C R I P T _ Z I B R A _ B A C K U P _ A L L _ A C C O U N T S / z i m b r a _ b a c k u p _ a l l a c c o u n t s . s h " e c h o" S e n d i n gf i l e st ob a c k u pa l le m a i la c c o u n t sf o rM a c h i n e 2( 1 0 . 0 . 0 . X-C r o s s O v e rC a b l eo ne t h 1\ o /). . . " r s y n ca v H$ Z B A C K U Pr o o t @ i p a d d r e s s : / o p t / z i m b r a _ b a c k u p _ a c c o u n t s b e f o r e 2 = " $ ( d a t e+ % s ) " # e c h oT h ep r o c e s sl a s t e d=$ ( d a t e+ % T ) #C a l c u l a t i n gt i m e a f t e r = " $ ( d a t e+ % s ) " e l a p s e d = " $ ( e x p r$ a f t e r-$ b e f o r e ) " h o u r s = $ ( ( $ e l a p s e d/3 6 0 0 ) ) e l a p s e d = $ ( ( $ e l a p s e d-$ h o u r s*3 6 0 0 ) ) m i n u t e s = $ ( ( $ e l a p s e d/6 0 ) ) s e c o n d s = $ ( ( $ e l a p s e d-$ m i n u t e s*6 0 ) ) e c h oT h ec o m p l e t eb a c k u pl a s t e d:" $ h o u r sh o u r s$ m i n u t e sm i n u t e s$ s e c o n d ss e c o n d s "
*S c r i p t2 z i m b r a B a c k u p A l l A c c o u n t s . s h
Z H O M E = / o p t / z i m b r a Z B A C K U P = $ Z H O M E / b a c k u p / m a i l b o x Z C O N F D = $ Z H O M E / c o n f D A T E = ` d a t e+ " % a " ` Z D U M P D I R = $ Z B A C K U P / $ D A T E Z M B O X = / o p t / z i m b r a / b i n / z m m a i l b o x i f[!d$ Z D U M P D I R] ;t h e n m k d i rp$ Z D U M P D I R f i e c h o"R u n n i n gz m p r o v. . ." f o rm b o xi n` z m p r o vlg a a ` d o e c h o"G e n e r a t i n gf i l e sf r o mb a c k u p$ m b o x. . . " $ Z M B O Xzm$ m b o xg e t R e s t U R L" / / ? f m t = z i p ">$ Z D U M P D I R / $ m b o x . z i p d o n e
RESTORE
*S c r i p t3 *T h i ss c r i p tm u s tb er u na sr o o t ,i tr u n st h es c r i p tr u n R e s t o r e A l l . s ha n da l s os e n d st h ee n t i r eb a c k u pt om a c h i n e . z i m b r a _ r e s t o r e _ a l l a c c o u n t s . s h
e c h o" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " e c h o" * Z i m b r a-R e s t o r ea l le m a i la c c o u n t s * " e c h o" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " e c h o" " # e c h oS t a r tT i m eR e s t o r e=$ ( d a t e+ % T ) b e f o r e = " $ ( d a t e+ % s ) " # e c h o" " e c h o" S t a r t i n gt h ep r o c e s sr e s t o r et h eb a c k u pf i l e s. . . " s u-z i m b r ac" / o p t / z i m b r a _ b a c k u p _ a c c o u n t s / z i m b r a _ r e s t o r e _ a l l a c c o u n t s . s h " b e f o r e 2 = " $ ( d a t e+ % s ) " e c h oT h ep r o c e s sl a s t e d=$ ( d a t e+ % T ) #C a l c u l a t i n gt i m e a f t e r = " $ ( d a t e+ % s ) " e l a p s e d = " $ ( e x p r$ a f t e r-$ b e f o r e ) " h o u r s = $ ( ( $ e l a p s e d/3 6 0 0 ) ) e l a p s e d = $ ( ( $ e l a p s e d-$ h o u r s*3 6 0 0 ) ) m i n u t e s = $ ( ( $ e l a p s e d/6 0 ) ) s e c o n d s = $ ( ( $ e l a p s e d-$ m i n u t e s*6 0 ) ) e c h o" T h ec o m p l e t er e s t o r el a s t e d:" $ h o u r sh o u r s$ m i n u t e sm i n u t e s$ s e c o n d ss e c o n d s " e c h o" P r o c e s sc o m p l e t e ds u c c e s s f u l l y ! "
*S c r i p t4 z i m b r a _ r e s t o r e _ a l l a c c o u n t s . s h
***SoonIwillbesendingthisimprovedscript!Italictext VerifiedAgainst:unknownandRichardsonLima DateCreated:3/28/2006 ArticleID:http://wiki.zimbra.com/index.php?title=Backing_up_and_restoring_Zimbra_(Open_Source_Version) DateModified:05/13/2010 Retrievedfrom"http://wiki.zimbra.com/index.php?title=Backing_up_and_restoring_Zimbra_(Open_Source_Version)&oldid=19753" Category: BackupandRestore Zimbra.com | PopularSearches | AboutZimbra
Learn
WhatisZimbra? Benefits DemosandVideos IndustrySolutions Customers CaseStudies Awards
Products
ZimbraCollaborationServer ZimbraCloudandVirtualization ZimbraOpenSource ZimbraDesktop CompareProducts Pricing WhatsNew Downloads
Community
Forums Documentation Wiki Blog Gallery SubmitBug ReleaseStatus DeveloperZone Contribute
Support
ZimbraSupportProgramOverview UserHelp ZimbraCustomerSupportPortal
Partners
About
Careers News Events Webinars Media ContactUs Twitter LinkedIn Facebook EmailSoftware EmailHosting ZimbraMailServer EmailArchivingandComplianceSoftware CalendarandCollaboration MicrosoftOutlookAlternative ZimbraforBlackBerry&iPhone SecureEmail&AntiSpam UnifiedMessaging Zimbraisopensourceserversoftwareforemailandcollaborationemail,groupcalendar,contacts,instantmessaging,filestorageandwebdocument management.TheZimbraemailandcalendarserverisavailableforLinux,MacOSXandvirtualizationplatforms.Zimbrasyncstosmartphones (iPhone,BlackBerry)anddesktopclientslikeOutlookandThunderbird.Zimbraalsofeaturesarchivinganddiscoveryforcompliance.Zimbracanbe deployedonpremisesorasahostedemailsolution. ZimbraDesktopisafreeemailandcalendarclientwhichrunsonanyWindows,AppleorLinuxdesktopcomputer.Itworksonlineandofflineand workswithanyPOPorIMAPemailaccountaswellasYahoo!Mail.