/etc/kopano/server.cfg contains the SQL username and password used by UCS
I learned what databases were present using
mysql -u kopanoDbUser -p
Your MariaDB connection id is 168
Server version: 10.1.47-MariaDB-0+deb9u1 Debian 9.13
Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
±-------------------+
| Database |
±-------------------+
| information_schema |
| kopano |
±-------------------+
2 rows in set (0.00 sec)
MariaDB [(none)]> exit
Per the Kopano documentation here https://documentation.kopano.io/kopanocore_administrator_manual/backup_restore.html
I built a Kopano DB backup
mysqldump -u kopanoDbUser -p --single-transaction --routines kopano -r /root/backup/kopano.sql
mysqldump -u kopanoDbUser -p --single-transaction --routines information_schema -r /root/backup/information_schema.sql
Enter password:
mysqldump: Couldn’t execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM XTRADB_RSEG
': Access denied; you need (at least one of) the PROCESS privilege(s) for this operation (1227)
I’m sorta assuming the information_schema database is the same across two UCS Kopano servers. I may do a compare to see.
Right now I am at the point where I have backed up the attachments and transferred them. I’ve restored the attachments to /var/lib/kopano/
I have transferred the DB dump and I’m currently restoring it using
mysql -u [user] -p [database_name] < [filename].sql
I have used info on the dead server to enumerate users and stores
List all orphaned mailboxes:
“kopano-cli --list-orphans”
this one is far more helpful … it says who the user was
kopano-admin --list-orphans
root@blade:~/backup# kopano-admin --list-orphans
The selected option is deprecated in this utility.
Forwarding call to: kopano-storeadm -O
.
Stores without users:
Store GUID Guessed username Last login Store size Store type
2fe41f83e18a456a91250671235a74be user1 18h ago 968.00 MB private
34607bfd20544c87bdf5852f74abc47e user2 21h ago 548.75 MB private
be8b6f6d906a4d64bb524fdcf183c306 user3 18h ago 4673.97 MB private
e57c77a3944642c6812f507df4b8c8c4 user4 19h ago 1421.49 MB private
f7c4302605e3449f9bb6f687ebe94ffd user5 366d ago 0.04 MB private
Users without stores:
Username
Everyone
That ended the guessing game to figure out which user is which
I found I could hook the store with a new local user on the new server with:
“kopano-cli --hook-store= -u ”
I found that even after a reboot and letting the box sit for a few hours that
permissions are a problem. My guess is this is because the userIDs are likely very different than they were.
I got a mailbox to show up after binding it to the user with
kopano-cli --user someone --add-permission ‘someone:folder_owner’