3.0 to 4.5.3 Upgrade failed (mysql error)

Ask questions about your setup or get help installing ZCS server (ZD section below).
dealt
Posts: 36
Joined: Fri Sep 12, 2014 9:56 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby dealt » Tue Mar 13, 2007 12:31 am

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


marcmac
Elite member
Elite member
Posts: 2091
Joined: Fri Sep 12, 2014 9:53 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby marcmac » Tue Mar 13, 2007 9:44 am

read the slapadd man page, tell it to use /opt/zimbra/conf/slapd.conf for it's config file.
dealt
Posts: 36
Joined: Fri Sep 12, 2014 9:56 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby dealt » Wed Mar 14, 2007 12:48 am

[quote user="marcmac"]read the slapadd man page, tell it to use /opt/zimbra/conf/slapd.conf for it's config file.[/QUOTE]
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
dealt
Posts: 36
Joined: Fri Sep 12, 2014 9:56 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby dealt » Wed Mar 14, 2007 7:06 am

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?
jholder
Zimbra Employee
Zimbra Employee
Posts: 4693
Joined: Fri Sep 12, 2014 10:00 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby jholder » Thu Mar 15, 2007 1:30 am

Delt,

I guess you figured out that you can't just copy stuff.

I'll ask Marc if he has any more input.
john
dealt
Posts: 36
Joined: Fri Sep 12, 2014 9:56 pm

3.0 to 4.5.3 Upgrade failed (mysql error)

Postby dealt » Tue Mar 20, 2007 12:30 am

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:

cp -rp /opt/zimbra /backup

2. (Backup user accounts) Create LDAP db dump file. As zimbra:

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...:

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:

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:

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):
#!/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:
#!/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...

Return to “Installation and Upgrade”

Who is online

Users browsing this forum: No registered users and 2 guests