@biggoof It is relatively simple to migrate the data from one Grommunio Appliance to a new one. A number of the regular posters on this forum produced the following steps a year or so ago that should help you along the way. This is best done in a VM environment as it allows you to take snapshot at each build milestone, so you can test and if you come across issues you can quickly have another go rather that having to start over. I have used this method several times, over the last couple of years as I build a new VM each time a new ISO is released, just keeps things clean in the OS bits.
Migrate Users and Data from Old server to New server.
- Update and reboot the source (old server) and target (new server) system: zypper refresh & & zypper update (could also use the updater in the admin GUI console
- Build new server installation identical to current live server. Follow build documentation (above) up to the point where the new server is running but no WebAdmin config has been done (no Org, Domain or users), call this ‘new server’ in the steps below.
- Stop inbound Internet email and user access to live server mailboxes to avoid missing emails during migration.
- Optional step - If Grommunio is in a Virtual Environment, 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 (run this command on both systems - should all be on one line):
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/
- Check the folder permissions and set folder permissions for Grommunio Core on new server off not as below:
chown -Rf grommunio:gromox /var/lib/gromox
chown -Rf gromox:gromox /var/lib/gromox
chown -Rf grommunio:gromox /var/lib/gromox/user/*
chmod -Rf 0770 /var/lib/gromox
chmod -Rf 0775 /var/lib/gromox/domain/*
- If using Grommunio Files set folder permissions for Grommunio Files on new server:
chown -Rf grofiles:grofiles /var/lib/grommunio-files/data
- Import of the MariaDB Grommunio database on new server:
mysql grommunio < /usr/local/share/grommunio.sql
- Import of the MariaDB Grofiles 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. Later versions of the appliance use domain instead of x and username instead of y, so /var/lib/gromox/user/yourdomain.com/user/
- Reboot
Finally test, test, test to make sure everything is working and all you emails, users etc have been migrated.
I only use Core and Files modules, so not sure what will be needed if you have data in additional modules, but the above should give you a good hint at to what will be needed to move. If you have done any customisation to RSpam settings, postfix etc, then these will also need to be migrated over (copy the configuration files from old to new server). Again I do not use/or need to make any changes to these services as I use an standalone SPAM solution that handles most of the stuff that RSpam and postfix do, in a much easier environment (free for up to 5 users).
Hope above helps you with your migration to the latest version.
Mark