Prerequisites
To be able to use these scripts, the Python Client must be installed on the machine.
Useful files
Procedure
The script restore.sh
will restore user data from the backup directory into a user's or another user's mailbox, as required, into a sub-folder named restored_<timestamp>
.
To start it:
./restore.sh USER|MAILSHARE BACKUP_PATH USER|MAILSHARE EMAIL_ADDRESS
USER|MAILSHARE
: to restore a user use the keyword USER, to restore a shared mailbox use the keyword MAILSHAREBACKUP_PATH
: path to the data in the BlueMind backup directory (/var/backups). The path looks like:User Mailshare/var/backups/bluemind/dp_spool/rsync/<IP>/mail/imap/<backup number>/var/spool/cyrus/data/<bluemind domain>/domain/<domain initial>/<domaine bluemind>/<user initial>/user/<user>/
E.g. for the user "jdoe" on the domain "bluemind.loc":
/var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/806/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/j/user/jdoe/
/var/backups/bluemind/dp_spool/rsync/<IP>/mail/imap/<sauvegarde>/var/spool/cyrus/data/<domaine>/domain/<initiale_domaine>/<domaine>/
You can see that for a mailbox, the path stops at the domain level. Therefore, the path is always the same for all mailshares of the domain.
E.g. in our sample domain "bluemind.loc", path will be:
/var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/806/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/
USER|MAILSHARE
: as for first keyword, indicates the target mailbox typeEMAIL_ADDRESS
: email address for the target mailbox you want to restore the data into
Then, you have 4 possibilities:
./restore.sh USER jdoe@bluemind.loc /var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/817/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/j/user/jdoe/ USER hannibal@bluemind.loc
./restore.sh USER jdoe@bluemind.loc /var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/817/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/j/user/jdoe/ MAILSHARE contact@bluemind.loc
./restore.sh MAILSHARE contact@bluemind.loc /var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/817/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/ USER jdoe@bluemind.loc
./restore.sh MAILSHARE contact@bluemind.loc /var/backups/bluemind/dp_spool/rsync/192.168.122.148/mail/imap/817/var/spool/cyrus/data/bluemind_loc/domain/b/bluemind.loc/ MAILSHARE contact@bluemind.loc