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 Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 09-04-2009, 08:00 AM
Moderator
 
Posts: 6,236
Default

Goal is to create an /opt/zimbra/data/ldap/ldap.bak

Quote:
Originally Posted by script
sub migrateLdap($) {
my ($migrateVersion) = @_;
if (main::isInstalled ("zimbra-ldap")) {
if($main::configStatus{"LdapMigrated$migrateVersion"} ne "CONFIGURED") {
if (-f "/opt/zimbra/data/ldap/ldap.bak") {
my $infile = "/opt/zimbra/data/ldap/ldap.bak";
my $outfile = "/opt/zimbra/data/ldap/ldap.60";
if ( -s $infile ) {
open(IN,"<$infile");
open(OUT,">$outfile");
while() {
if ($_ =~ /^zimbraPrefStandardClientAccessilbityMode:/) {next;}
if ($_ =~ /^objectClass: zimbraHsmGlobalConfig/) {next;}
if ($_ =~ /^objectClass: zimbraHsmServer/) {next;}
print OUT $_;
}
} else {
main:rogress("Valid backup file not found, exiting.\n");
return 1;
}
A way to generate a LDIF output is a slapcat:
Code:
openldap/sbin/slapcat -f /opt/zimbra/conf/slapd.conf -l /tmp/ldap.ldif
We even roll it into a easier utility:
Quote:
Originally Posted by zmslapcat
${zimbra_home}/openldap/sbin/slapcat -F ${zimbra_home}/data/ldap/config -b "" -l $DEST/ldap.bak.${D}
cp -f ${DEST}/ldap.bak.${D} ${DEST}/ldap.bak
So run this:
Code:
su - zimbra
cd /opt/zimbra/libexec
./zmslapcat /opt/zimbra/data/ldap
Should produce a ldap.bak & ldap.bak.date in /opt/zimbra/data/ldap.

~~~
You don't need to restore but here's how you'd use slapadd:
Code:
/opt/zimbra/openldap/sbin/slapadd -f /opt/zimbra/conf/slapd.conf -l /tmp/ldap.ldif

That command would only work in 5.x since in 6.x OpenLDAP now allows for some on-the-fly configuration changes with zmlocalconfig via a cn=config backend instead of slapd.conf text files for preservation across upgrades.
So, if something went wrong it's better to run:
Code:
/opt/zimbra/openldap/sbin/slapadd -q -b "" -F /opt/zimbra/data/ldap/config/ -cv -l ldap.bak
Edit: You may have a good ldap.bak.timestamp that's not zero length (caused by running the installer multiple times) to use first rather than taking a new one.

Quote:
Originally Posted by mmorse View Post
Bug 43591 – ldap.bak issues on GNR upgrades

Quanah also pointed out that depending on when you create this ldap.bak (if your not using one that was created earlier like ldap.bak.timestamp) have to be using the 5.0 slapcat/sleepycatlibs for BDB differences with 6.0 to get a valid backup.

Last edited by mmorse; 12-17-2009 at 12:29 PM..
Reply With Quote
  #12 (permalink)  
Old 09-04-2009, 08:56 AM
New Member
 
Posts: 3
Default

many files ldap.bak and ldap.bak.{DATE} in /opt/zimbra/data/ldap, but his size 0...
Reply With Quote
  #13 (permalink)  
Old 09-04-2009, 09:27 AM
Active Member
 
Posts: 42
Default

Quote:
Originally Posted by vitall View Post
many files ldap.bak and ldap.bak.{DATE} in /opt/zimbra/data/ldap, but his size 0...
Hey

The same here...

Quote:
-rw-r----- 1 zimbra zimbra 69634 Sep 4 11:53 ldap.bak.20090904115346
drwxr-xr-x 4 zimbra zimbra 4096 Sep 4 11:54 hdb
drwxr-xr-x 3 zimbra zimbra 4096 Sep 4 11:56 config
-rw-r----- 1 zimbra zimbra 0 Sep 4 12:27 ldap.bak.20090904122749
-rw-r----- 1 zimbra zimbra 0 Sep 4 12:47 ldap.bak.20090904124759
-rw-r----- 1 zimbra zimbra 0 Sep 4 12:59 ldap.bak.20090904125911
-rw-r----- 1 zimbra zimbra 0 Sep 4 13:09 ldap.bak.20090904130907
-rw-r----- 1 zimbra zimbra 0 Sep 4 13:19 ldap.bak.20090904131958
-rw-r----- 1 zimbra zimbra 0 Sep 4 14:22 ldap.bak.20090904142254
-rw-r----- 1 zimbra zimbra 0 Sep 4 15:07 ldap.bak.20090904150745
-rw-r----- 1 zimbra zimbra 0 Sep 4 17:17 ldap.bak.20090904171754
-rw-r----- 1 zimbra zimbra 0 Sep 4 17:19 ldap.bak.20090904171934
-rw-r----- 1 zimbra zimbra 0 Sep 4 17:19 ldap.bak
Same here - only zero lenght files created as Backup - error is still there
Reply With Quote
  #14 (permalink)  
Old 09-04-2009, 08:23 PM
Active Member
 
Posts: 42
Default

Hmm - has anyone an idea?
Reply With Quote
  #15 (permalink)  
Old 09-05-2009, 01:47 AM
Moderator
 
Posts: 7,911
Default

Have you tried the commands that both mmorse and myself have posted ?
__________________
Reply With Quote
  #16 (permalink)  
Old 09-05-2009, 02:38 AM
Active Member
 
Posts: 42
Default

yes, i have. It creates 2 files named ldap.bak and ldap.bak.$TIMESTAMP in
/opt/zimbra/data/ldap/ - both Files have the size 0.

After that, i started install.sh - and the same error appears. Could not find any valid Backup File
Reply With Quote
  #17 (permalink)  
Old 09-05-2009, 02:42 AM
Moderator
 
Posts: 7,911
Default

Has the install script actually updated the core ZCS files ?

I am wondering, as mmorse has said, that due to the changes to the schema etc the command that is being executed in the ZCS6 zmslapcat is failing for some reason when query a V5 LDAP database.
__________________
Reply With Quote
  #18 (permalink)  
Old 09-05-2009, 02:48 AM
Moderator
 
Posts: 7,911
Default

Okay, try running this
Code:
su - zimbra
/opt/zimbra/openldap/sbin/slapcat -F /opt/zimbra/data/ldap/config -b "" -l /opt/zimbra/data/ldap/ldap.bak
Does it just return to the command prompt ? Any errors produced ? Try removing the ldap.bak files from /opt/zimbra/data/ldap first (I would just create a backup directory under there and move the files into it).
__________________
Reply With Quote
  #19 (permalink)  
Old 09-05-2009, 02:56 AM
Active Member
 
Posts: 42
Default

Quote:
Originally Posted by uxbod View Post
Has the install script actually updated the core ZCS files ?
Of course - if i run install.sh with the switch "-s" the script ended with no errors.

Quote:
Software Installation complete!

Operations logged to /tmp/install.log.13103

Run /opt/zimbra/libexec/zmsetup.pl to configure the system
So - after that, i run zmsetup.pl

Quote:
root@server:/# /opt/zimbra/libexec/zmsetup.pl
Operations logged to /tmp/zmsetup.09052009-105213.log
Upgrading from 5.0.18_GA_3011 to 6.0.0_GA_1802
Stopping zimbra services...done.
Verifying /opt/zimbra/conf/my.cnf
Starting mysql...done.
This appears to be 5.0.18_GA
Stopping mysql...done.
Valid backup file not found, exiting.
UPGRADE FAILED - exiting.
dpkg --list says, that version 6 is installed

Quote:
ii zimbra-apache 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-core 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-ldap 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-logger 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-memcached 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-mta 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-proxy 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-snmp 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-spell 6.0.0_GA_1802.UBUNTU6 Best email money can buy
ii zimbra-store 6.0.0_GA_1802.UBUNTU6 Best email money can buy
...also a zmcontrol -v

Quote:
zimbra@server:~$ zmcontrol -v


Release 6.0.0_GA_1802.UBUNTU6 UBUNTU6 FOSS edition.
Reply With Quote
  #20 (permalink)  
Old 09-05-2009, 03:02 AM
Active Member
 
Posts: 42
Default

Quote:
Originally Posted by uxbod View Post
Okay, try running this
Code:
su - zimbra
/opt/zimbra/openldap/sbin/slapcat -F /opt/zimbra/data/ldap/config -b "" -l /opt/zimbra/data/ldap/ldap.bak
Does it just return to the command prompt ? Any errors produced ? Try removing the ldap.bak files from /opt/zimbra/data/ldap first (I would just create a backup directory under there and move the files into it).

ok, it creates a file name ldap.bak with also zero lenght. installation ended after that with the same error

Quote:
zimbra@server:~/data/ldap$ rm ldap.bak*
rm: remove regular empty file `ldap.bak'? y
zimbra@server:~/data/ldap$ /opt/zimbra/openldap/sbin/slapcat -F /opt/zimbra/data/ldap/config -b "" -l /opt/zimbra/data/ldap/ldap.bak
zimbra@server:~/data/ldap$ ls -ltr
total 8
drwxr-xr-x 4 zimbra zimbra 4096 Sep 4 11:54 hdb
drwxr-xr-x 3 zimbra zimbra 4096 Sep 4 11:56 config
-rw-r----- 1 zimbra zimbra 0 Sep 5 11:00 ldap.bak
zimbra@server:~/data/ldap$
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.