tf91 I have successfully been using the following procedure to migrate the data (Org, Domain, Users and the emails etc) from one appliance build to 'the latest and greatest' since early summer last year, as exporting and importing via Outlook was getting tedious.
I always make a clone of the my live Grommunio Appliance VM first, and do a full test migration on that clone to catch any issues before migration of my live server. Good use of snapshots made here to save having to rebuild the appliance from the ISO if things don't go to plan.
And it goes without saying once you have completed the migration - TEST - TEST - TEST. If all goes well you can now migrate your actual live server/appliance, in the knowledge you have already successfully tested the process.
Migrate Users and Data from Old server to New server.
1. Build a new appliance as normal - up to the point where you would start adding the Organisation Name, Domain and Users - this will all be imported via the process below), call this ‘new server’ in the steps below. Check you can log into it and any certificates are applied. It should work like your live server but without any data.
- Update and reboot the source (old server) and target (new server) system: zypper refresh & & zypper update (or use the Update/Upgrade Options in the GUI if you have it).
- If you can, stop inbound Internet email and user access to the live server mailboxes to avoid missing emails during migration. This should not happen as point 5 below will stop all services on old and new servers, but always a good option if you have it.
- Jus incase you missed this above - If you are using Grommunio in a Virtual Machine then optionally clone live server to avoid any damage/corruption to current live server during migration (call this ‘old server’ in steps below), just in case you need to revert to what was your current live server.
- Stop services on both systems: systemctl --all --output json list-units| jq '.[]|select(.unit|test("(grom.|nginx|.fpm).service")).unit' |xargs systemctl stop
- Export of the MariaDB database on old server: mysql --execute="SHOW DATABASES" --skip-column-names --batch |grep -Ev '^(mysql|(performance|information)_schema)$' |while read -r DB; do mysqldump --single-transaction --routines --triggers --events --add-drop-database $DB > /usr/local/share/$DB.sql ; done
- User Data - transfer old server to new server: rsync -aH -essh --delete --numeric-ids -P --stats --inplace /var/lib/gromox/ root@192.168.xxx.xxx:/var/lib/gromox/
- Move MariaDB backup (from step 6) from old system to new system. Run this on old server: rsync -aH -essh --delete --numeric-ids -P --stats --inplace /usr/local/share/ root@192.168.xxx.xxx:/usr/local/share/
- Set folder permissions for Grommunio Core on new server: chown -Rf grommunio:gromox /var/lib/gromox
- If you use Grommunio Files - Set folder permissions for Grommunio Files on new server: chown -Rf grofiles:grofiles path-to-your-grommuniuo-files-data-directory
- Import of the MariaDB Grommunio database on new server: mysql grommunio < /usr/local/share/grommunio.sql
- If you use Grommunio Files - Import of the MariaDB Grommunio Files database on new server: mysql grofiles < /usr/local/share/grofiles.sql
- Import of the MariaDB system database on new server: mysql sys < /usr/local/share/sys.sql
- Check import user /var/lib/gromox/user/x/y/: run grommunio-admin user query username maildir on both systems - make sure they match.
- Reboot
The text in bold above can be copied and pasted into an SSH terminal to save you typing the commands.
If you are using any other options of the Grommunio Groupware, then you will need to add the relevant migrations to the above plane as I only use Grommunio Mail and Files at this time.
Hope the above is of use to you.
Thanks to @Andy, @WalterH and others who through their various posts during spring/summer last year helped me derive the above process. Hope it will assist many others, old and new, in the community with an easier upgrade path when a new appliance in made available.
I am always welcome to to suggestions for tweaks/improvements to the process as they may well make the process of migrating a little less of the challenge I found when I first started using Grommunio in August 2022.
Mark