Koozali.org: home of the SME Server

Manually copying mail to new server, is this possible?

Offline jarthurs

  • **
  • 29
  • +0/-0
Manually copying mail to new server, is this possible?
« on: November 15, 2017, 07:08:07 PM »
I had a server fail due to a bad capacitor on the motherboard, I've restored the last full backup to new hardware and everything is running fine.

I've mounted the RAID volume and recovered a couple of documents that were updated however there are a few emails between the last backup and the failure time. Is there any way of manually exporting them and having the new server re-index them into the new mail database?

Regards,
Jason.

Offline ReetP

  • *
  • 3,954
  • +6/-0
Re: Manually copying mail to new server, is this possible?
« Reply #1 on: November 15, 2017, 07:58:30 PM »
If you know the files it should be fine.

Mails are 'just another file'.

Copy them over and make sure the perms are ok and they should get indexed and added ok.

If in any doubt TEST TEST TEST :-)

Have yourself an old box, or better still in this day and age a vm you can practice on.

B. Rgds
John
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Manually copying mail to new server, is this possible?
« Reply #2 on: November 15, 2017, 08:16:11 PM »
mails are in the Maildir folder of each user home, meaning:

/home/e-smith/Maildir for admin

/home/e-smith/files/users/USERNAME/Maildir for others

just rsync from one machine to another for every users and you should be correct.

There also alternative using imap to sync the emails https://wiki.contribs.org/Imapsync

Offline jarthurs

  • **
  • 29
  • +0/-0
Re: Manually copying mail to new server, is this possible?
« Reply #3 on: November 15, 2017, 08:43:51 PM »
There are three days between the last full backup and the old server going 'pop' and it's only one particular user who is missing messages so they shouldn't be hard to track down. I just wanted to check that injecting them directly into the folders wasn't going to cause any fallout.

Thanks,
Jason.


Offline Jean-Philippe Pialasse

  • *
  • 2,912
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Manually copying mail to new server, is this possible?
« Reply #4 on: November 15, 2017, 09:21:15 PM »
the only issue you might get is duplicates, or deleted /sorted messages poping back, which is a minor issue.


just pay attention that ownership are the same after restore.

JP

Offline jarthurs

  • **
  • 29
  • +0/-0
Re: Manually copying mail to new server, is this possible?
« Reply #5 on: November 16, 2017, 01:40:12 PM »
I did have one folder where the permissions were an issue but a quick chown user:group solved it.

Many Thanks,
Jason.

the only issue you might get is duplicates, or deleted /sorted messages poping back, which is a minor issue.


just pay attention that ownership are the same after restore.

JP