-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20d1903
commit fc5da4d
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Tagged Zimbra Downgrade | ||
|
||
## Introduction | ||
|
||
Have you tried to downgrade from a develop-branch build (i.e. ianw1974 builds) to a tagged build (i.e. Maldua builds) and found out that the installation abruptly ended with this message: | ||
|
||
``` | ||
Creating server entry for mail.zimbrademo.net...already exists. | ||
Setting Zimbra IP Mode...done. | ||
Saving CA in ldap...failed. | ||
``` | ||
|
||
? | ||
|
||
Here there is an script to fix it. | ||
|
||
## How to fix this | ||
|
||
Make sure that Zimbra has started: | ||
``` | ||
sudo su - zimbra -c 'zmcontrol start' | ||
``` | ||
|
||
Download and apply the fix: | ||
``` | ||
sudo su - zimbra | ||
cd /tmp | ||
wget 'https://github.com/maldua/zimbra-foss-builder/raw/main/tools/tagged-zimbra-downgrade/tagged-zimbra-downgrade.sh' | ||
chmod +x tagged-zimbra-downgrade.sh | ||
./tagged-zimbra-downgrade.sh | ||
``` | ||
|
||
Say **y** to the question and press enter | ||
|
||
Finally end the zimbra session thanks to: | ||
``` | ||
exit | ||
``` | ||
|
||
## Now just install/upgrade again | ||
|
||
Use your tagged installation (i.e. Maldua installation): | ||
``` | ||
./install.sh | ||
``` | ||
to install/upgrade so that the installation is properly completed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
LDAP_DOWNGRADE_FIX_DIR="/opt/zimbra/conf/scripts/LDAP_DOWNGRADE_FIX" | ||
|
||
function usage { | ||
|
||
$0 | ||
|
||
} | ||
|
||
function fixBorkedLdap { | ||
|
||
mkdir -p ${LDAP_DOWNGRADE_FIX_DIR} | ||
/opt/zimbra/libexec/zmslapcat ${LDAP_DOWNGRADE_FIX_DIR} | ||
echo 'You can ignore xxxxxxx UNKNOWN attributeDescription "ZIMBRAxxxxxxxxxxxx" inserted. messages from above.' | ||
|
||
# Actual fix | ||
cp ${LDAP_DOWNGRADE_FIX_DIR}/ldap.bak ${LDAP_DOWNGRADE_FIX_DIR}/ldap_TO-BE-FIXED.bak | ||
cat ${LDAP_DOWNGRADE_FIX_DIR}/ldap_TO-BE-FIXED.bak | grep -v -E '^ZIMBRA' > ${LDAP_DOWNGRADE_FIX_DIR}/ldap.bak | ||
|
||
# Extra dumps not actually needed | ||
/opt/zimbra/libexec/zmslapcat -c ${LDAP_DOWNGRADE_FIX_DIR} | ||
/opt/zimbra/libexec/zmslapcat -a ${LDAP_DOWNGRADE_FIX_DIR} | ||
|
||
# Stop zimbra and remove old ldap database | ||
zmcontrol stop | ||
|
||
mv /opt/zimbra/data/ldap/mdb /opt/zimbra/data/ldap/mdb.old_LDAP_DOWNGRADE_FIX | ||
mkdir -p /opt/zimbra/data/ldap/mdb/db | ||
|
||
# Import sanitized ldap dump | ||
/opt/zimbra/libexec/zmslapadd ${LDAP_DOWNGRADE_FIX_DIR}/ldap.bak | ||
} | ||
|
||
if [ "x$(id -u -n)" != "xzimbra" ]; then | ||
echo "Please run as ZIMBRA user" | ||
echo "Exiting..." | ||
exit 1 | ||
fi | ||
|
||
### | ||
|
||
read -p "This will restart Zimbra. Are you sure?" -r restart_choice | ||
if [[ $restart_choice =~ ^[Yy]$ ]] ; then | ||
echo "Processing..." | ||
fixBorkedLdap | ||
echo "...Done." | ||
echo "Now starting Zimbra..." | ||
zmcontrol start | ||
else | ||
echo "Aborted by the user." | ||
fi |