Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Installation

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack (1) Thread Tools Display Modes
  #31 (permalink)  
Old 03-12-2007, 11:31 PM
Active Member
 
Posts: 36
Default

It seems that I messed up even my backup..i'm having a port conflict problem (on ldap) when I try to reinstall 3.0.1 with my backup in place.

It seems that all of these problems are caused by messed up LDAP. Since I already have dump file my ldap db, can I just make a fresh install of 4.5.3, import my ldap dump file, then manually copy the mails and other files from my "upgraded but failed on ldap" 3.0 install? If yes, what are these files? is the store/ directory enough?

Thanks
Reply With Quote
  #32 (permalink)  
Old 03-13-2007, 08:44 AM
Zimbra Employee
 
Posts: 2,073
Default

read the slapadd man page, tell it to use /opt/zimbra/conf/slapd.conf for it's config file.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #33 (permalink)  
Old 03-13-2007, 11:48 PM
Active Member
 
Posts: 36
Default

Quote:
Originally Posted by marcmac View Post
read the slapadd man page, tell it to use /opt/zimbra/conf/slapd.conf for it's config file.
Hi! If this was to import the said ldap dump file, i think i've tried this in my previous post. i'm trying a manual migration right now
Reply With Quote
  #34 (permalink)  
Old 03-14-2007, 06:06 AM
Active Member
 
Posts: 36
Default

I just need to restore the mails from the "upgraded 3.0.1 to 4.5.3 with broken ldap". I tried manually copying index/ , db/, store/, mysql/ but I ended up with errors. How can I restore the mail files?
Reply With Quote
  #35 (permalink)  
Old 03-15-2007, 12:30 AM
Zimbra-Yahoo Consultant
 
Posts: 5,608
Default

Delt,
I guess you figured out that you can't just copy stuff.
I'll ask Marc if he has any more input.

john
Reply With Quote
  #36 (permalink)  
Old 03-19-2007, 11:30 PM
Active Member
 
Posts: 36
Default Upgrade Workaround

Hi! After weeks of trying and with the generous assistance (and patience) of the people here I managed to upgrade my 3.0 installation to 4.5.3 release. Here are the steps I took:

1. Backup your working zimbra directory (3.0). As root:
Code:
cp -rp /opt/zimbra /backup
2. (Backup user accounts) Create LDAP db dump file. As zimbra:
Code:
su - zimbra
slapcat -l nameofdumpfile.ldif
3. (Backup mailbox ids from database) This is neccessary to properly re-inject the messages. The ids with their corresponding usernames from the previous installation will be used to tell zmlmtpinject the mail directories of each user from our backup. I believe this is information is saved in mailbox table therefore...:
Code:
su - zimbra
mysql zimbra
select * from mailbox
shall do the trick. Just find way to save the result in a text file or somewhere which you can use later.

I actually missed this step, good thing I have a list of our user accounts which I used in populating our zimbra ldap database before.


** BE SURE TO HAVE YOUR BACKUP AS MENTIONED ABOVE BEFORE CONTINUING ***


4. Install a fresh 4.5.3 zimbra. DO NOT CHOOSE UPGRADE!. This will overwrite everything in /opt/zimbra/ so be sure that you have your backup.

5. Import user accounts from LDAP dump file:
Code:
su - zimbra
slapadd -v -l /path/to/nameofdumpfile.ldif -c
6. Restore mails (using zmlmptinject). This is the tricky part since I didnt manage to backup the mailbox ids and what I have is a text file with the list of user accounts:
Code:
admin@mydomain.com
user1@mydomain.com
user2@mydomain.com
Checking the mails directory (/backup/zimbra/store/0/*) in my backup I noticed that mails in dir 0 was for admin, dir 1 was for user1 and so forth. That's why I was able to use this list to get the previous mailbox ids of our users (their order of appearance in the list) and use these ids as reference in importing their mails. (The following shell scripts requires the user accounts list as described above. Just modify the scripts below to use the result of mysql query in step no.3.)

As mentioned in this thread
the mails can be pre-proccessed before reinjecting to fix the dates. I downloaded and used the zimdates script posted in that thread and used it in this script (modify to suit the path to your backup directory):

Code:
#!/bin/bash

# define counter
accountCounter=1
# read user accounts file (accounts.txt). traverse through each line
cat accounts.txt | while read line; do

# cd to user's mail dir
cd /opt/backup/zimbra3.0_02062007/store/0/$accountCounter/msg/

# get content in current dir
contents=$(ls)
for loopFile in $contents
do
# run command
./zimdates.sh /backup/zimbra3.0_02062007/store/0/$accountCounter/msg/$loopFile/
done

# increment counter
let "accountCounter=$accountCounter + 1"

done
After fixing the date, inject the mails:

Code:
#!/bin/bash

# define counter
accountCounter=1
# read user accounts file (accounts.txt). traverse through each line
cat accounts.txt | while read line; do

# run command
/opt/zimbra/bin/zmlmtpinject -s ${line} -d /backup/zimbra3.0_02062007/store/0/$accountCounter/msg/* -r ${line}

# increment counter
let "accountCounter=$accountCounter + 1"

done

I hope this will be of help to anybody. Big thanks to john (jholder) and mark. Can the title of this thread be edited? the (mysql error) part in the title can be misleading. Thanks again!

Now if I can only "clean" the reinjected mails for spam...

Last edited by dealt : 03-19-2007 at 11:38 PM.
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0