Skip to content

Commit 0300eba

Browse files
WalterHofjengelh
authored andcommitted
scripts: explicit support for organizations in kopano2grommunio.sh
1 parent 5ad1488 commit 0300eba

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

tools/kopano2grommunio.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# A bash script for Kopano 2 grommunio migration.
44
#
5-
# Copyright 2022-2024 Walter Hofstaedtler
5+
# Copyright 2022-2025 Walter Hofstaedtler
66
# SPDX-License-Identifier: AGPL-3.0-or-later
77
# Authors: grommunio <[email protected]>
88
# Walter Hofstaedtler <[email protected]>
@@ -181,6 +181,8 @@
181181
# Otherwise, the script waits for a command from the admin in case of an error and that
182182
# the whole night long, thereby destroying valuable migration time.
183183
#
184+
# If an organization is registered with the domain, the organization must be specified here in the script.
185+
#
184186
# The other settings are explained in the variables.
185187
#
186188
# 7. Test the migration
@@ -189,13 +191,13 @@
189191
# 8. If you delete all mailboxes and Public Store on grommunio,
190192
# restart the grommunio server or its services before starting the migration again, to clear all caches.
191193
#
192-
# 9. clean up the grommunio server
194+
# 9. Clean up the grommunio server
193195
#
194-
# 9.1. remove sshfs from grommunio server
196+
# 9.1. Remove sshfs from grommunio server
195197
# grommunio Appliance / SUSE: zypper remove sshfs
196198
# Debian / Ubuntu: apt-get remove --purge sshfs
197199
#
198-
# 9.2. remove the mount directory
200+
# 9.2. Remove the mount directory
199201
# rmdir /mnt/kopano/
200202
#
201203
#
@@ -263,6 +265,12 @@ MigrationList="/tmp/k2g_list.txt"
263265
# The mapping file contains mappings for Zarafa addresses to MAPI addresses
264266
KdbUidMap="/tmp/kdb-uidextract.map"
265267

268+
# If an organization is registered with the domain, it must be specified here.
269+
# If the organization is not specified, the script cannot create the mailbox
270+
# and returns an invalid domain error.
271+
# If no organization is registered with the domain, leave this variable blank.
272+
Organization=""
273+
266274
# Create a sample $MigrationList file. An existing $MigrationList will not be overwritten.
267275
# For normal migration, set this variable to 0.
268276
CreateSampleMigrationList=0
@@ -515,7 +523,11 @@ while IFS= read -r line; do
515523
else
516524
if [[ $CreateGrommunioMailbox -eq 1 ]]; then
517525
Write-MLog "Try to create the mailbox: $MigMBox" yellow
518-
grommunio-admin ldap downsync -l $MailboxLanguage "$MigMBox" | tee -a $LOG
526+
if [[ -z $Organization ]]; then
527+
grommunio-admin ldap downsync -l "$MailboxLanguage" "$MigMBox" | tee -a "$LOG"
528+
else
529+
grommunio-admin ldap downsync -o "$Organization" -l "$MailboxLanguage" "$MigMBox" | tee -a "$LOG"
530+
fi
519531
ExitCode=${PIPESTATUS[0]}
520532
# currently (Jan. 2024) grommunio-admin always return error code 0 = success,
521533
# this prevents the error detection in this step. [DESK-1609]

0 commit comments

Comments
 (0)