Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36

Thread: 3.0 to 4.5.3 Upgrade failed (mysql error)

  1. #31
    Join Date
    Sep 2005
    Posts
    36
    Rep Power
    10

    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

  2. #32
    Join Date
    Sep 2005
    Posts
    2,103
    Rep Power
    14

    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!

  3. #33
    Join Date
    Sep 2005
    Posts
    36
    Rep Power
    10

    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

  4. #34
    Join Date
    Sep 2005
    Posts
    36
    Rep Power
    10

    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?

  5. #35
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    21

    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

  6. #36
    Join Date
    Sep 2005
    Posts
    36
    Rep Power
    10

    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 10:38 PM.

Similar Threads

  1. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  2. Replies: 18
    Last Post: 03-20-2006, 01:22 PM
  3. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 12:01 PM
  4. Building native libraries on MacOS X
    By ajmas in forum Developers
    Replies: 3
    Last Post: 10-14-2005, 11:00 PM
  5. Insallation failed (Debian server)
    By popui007 in forum Installation
    Replies: 5
    Last Post: 09-29-2005, 02:27 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
  •