Submitted by isdahlc on Mon, 11/28/2011 - 11:41 Pro Licensee
Guys,
How do I restore 1 mail user from backup?
The web interface doesn't allow me to restore a single user, can I do this from the command line?
Thanks! -- Craig
Status:
Active
Comments
Submitted by isdahlc on Mon, 11/28/2011 - 11:48 Pro Licensee Comment #1
I thought maybe something like this would work but it appears the
--only-missing
flag relates to the actual domain name.virtualmin restore-domain --source /tmp/backup-files/backup/domain.com.tar.gz --test --domain domain.com --feature mail --only-missing
How do you recommend / what is the best way to restore a single email user account?
Thanks!
-- Craig
Submitted by andreychek on Mon, 11/28/2011 - 11:56 Comment #2
Howdy -- it's unfortunately not possible to restore just one user.
If you're just looking to restore some files for that one user, you could always manually open that backup archive, and then copy the files in question to the user's account.
Submitted by isdahlc on Mon, 11/28/2011 - 12:03 Pro Licensee Comment #3
The actual email files aren't a problem since we use Bacula and backup /home/domain/homes directly. I was hoping to be able to restore the actual email account/password/aliases/spam/vacation settings for that user.
I'm not sure what's involved but it would basically be "creating" a new account but passing the create info from the backup file since all the info is there as we can restore all users. It wold be a good feature.
Thanks for the speedy response!
-- Craig
Submitted by isdahlc on Mon, 11/28/2011 - 12:26 Pro Licensee Comment #4
For those of you with a similar need, here's what I did to accomplish restoring one email user.
1) Create the email user in Virtualmin
2) Restore the email files from backup (in our case from Bacula) to /home/domain/homes/user
3) Set/Reset the password for the user so they can login
-- Craig
Submitted by isdahlc on Thu, 12/01/2011 - 10:05 Pro Licensee Comment #5
Ok, this did not work... Everything is there and user mail directory has the correct permissions but the user cannot see email in the Inbox (I verified by logging into Usermin as the user). BUT I can see the Inbox emails when viewing through Virtualmin.
I verified the ../.usermin/mailbox/inbox.imap file is correct
# cat .usermin/mailbox/inbox.imap
user=*
pass=123456
It acts like its permission related but everything iin ../home/user is set to user:domain permissions. Is there anything else I can check?
-- Craig
Submitted by andreychek on Thu, 12/01/2011 - 10:09 Comment #6
What error do you see in /var/log/maillog when this problem occurs?
Submitted by isdahlc on Thu, 12/01/2011 - 13:43 Pro Licensee Comment #7
I don't see any errors, email are there but the user just cant see them...
Submitted by danee on Thu, 12/01/2011 - 14:11 Comment #8
I have the same issue, I just copied the email messages from a backup to the Maildir/cur folder of one user (which was empty) and see nothing in Usermin inbox. The files permission and owner are correct.
Submitted by andreychek on Thu, 12/01/2011 - 14:20 Comment #9
I have a suspicion that there's a permissions problem of some sort; the files would need to be owned by the email user, and not the Virtual Server owner.
If you go into "/home/DOMAIN/homes/USERNAME/Maildir/cur", what output do you receive if you type this command:
ls -la
Submitted by isdahlc on Thu, 12/01/2011 - 14:21 Pro Licensee Comment #10
I got it!! Delete the files
.../homes/user/Maildir/dovecot*
then restart dovecot. Problem fixed!Thanks! -- Craig
Submitted by andreychek on Thu, 12/01/2011 - 14:25 Comment #11
Aha, so it's a Dovecot index file problem; and those would indeed be re-created if they were deleted.
I'm glad you got it figured out!
Submitted by danee on Thu, 12/01/2011 - 14:33 Comment #12
I copied the files with the "cp -p" command so they have the same owner/permission as those contained in the backup.
I confirm that deleting all Maildir/dovecot* files and restarting dovecot solves the problem. Thanks Craig!