|
2 | 2 | # |
3 | 3 | # A bash script for Kopano 2 grommunio migration. |
4 | 4 | # |
5 | | -# Copyright 2022-2024 Walter Hofstaedtler |
| 5 | +# Copyright 2022-2025 Walter Hofstaedtler |
6 | 6 | # SPDX-License-Identifier: AGPL-3.0-or-later |
7 | 7 | # Authors: grommunio <[email protected]> |
8 | 8 | # Walter Hofstaedtler <[email protected]> |
|
181 | 181 | # Otherwise, the script waits for a command from the admin in case of an error and that |
182 | 182 | # the whole night long, thereby destroying valuable migration time. |
183 | 183 | # |
| 184 | +# If an organization is registered with the domain, the organization must be specified here in the script. |
| 185 | +# |
184 | 186 | # The other settings are explained in the variables. |
185 | 187 | # |
186 | 188 | # 7. Test the migration |
|
189 | 191 | # 8. If you delete all mailboxes and Public Store on grommunio, |
190 | 192 | # restart the grommunio server or its services before starting the migration again, to clear all caches. |
191 | 193 | # |
192 | | -# 9. clean up the grommunio server |
| 194 | +# 9. Clean up the grommunio server |
193 | 195 | # |
194 | | -# 9.1. remove sshfs from grommunio server |
| 196 | +# 9.1. Remove sshfs from grommunio server |
195 | 197 | # grommunio Appliance / SUSE: zypper remove sshfs |
196 | 198 | # Debian / Ubuntu: apt-get remove --purge sshfs |
197 | 199 | # |
198 | | -# 9.2. remove the mount directory |
| 200 | +# 9.2. Remove the mount directory |
199 | 201 | # rmdir /mnt/kopano/ |
200 | 202 | # |
201 | 203 | # |
@@ -263,6 +265,12 @@ MigrationList="/tmp/k2g_list.txt" |
263 | 265 | # The mapping file contains mappings for Zarafa addresses to MAPI addresses |
264 | 266 | KdbUidMap="/tmp/kdb-uidextract.map" |
265 | 267 |
|
| 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 | + |
266 | 274 | # Create a sample $MigrationList file. An existing $MigrationList will not be overwritten. |
267 | 275 | # For normal migration, set this variable to 0. |
268 | 276 | CreateSampleMigrationList=0 |
@@ -515,7 +523,11 @@ while IFS= read -r line; do |
515 | 523 | else |
516 | 524 | if [[ $CreateGrommunioMailbox -eq 1 ]]; then |
517 | 525 | 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 |
519 | 531 | ExitCode=${PIPESTATUS[0]} |
520 | 532 | # currently (Jan. 2024) grommunio-admin always return error code 0 = success, |
521 | 533 | # this prevents the error detection in this step. [DESK-1609] |
|
0 commit comments