Author Topic: Where is the mail stored in the filesystem?  (Read 51707 times)

auerhaan

  • Zen Monk
  • **
  • Posts: 54
  • Karma: +2/-0
    • View Profile
    • Auerhaan
Re: Where is the mail stored in the filesystem?
« Reply #15 on: March 06, 2014, 04:59:51 pm »
Mail is stored in a MYSQL db and attachments are stored in the filesystem when you are using Zarafa.

I've used the following procedure to backup mail and attachments on a server and restore it on another server.

Commands have to be performed with sudo or after sudo su

Backup
-------

STOP ZARAFA-SERVER
Code: [Select]
service zarafa-server stop
MAKE COPY OF EXISTING ATTACHMENTS
Code: [Select]
cd /var/lib/zarafa
tar -cvzf /var/tmp/attachments.tgz ./

FIND DATABASE PASSWORD
Code: [Select]
cat /var/lib/zentyal/conf/ebox-zarafa.passwd
DUMP MYSQL DATABASE
Code: [Select]
mysqldump -u zarafa -p -v --single-transaction zarafa > /var/tmp/zarafadump.sql
In /var/tmp/ you've got the files attachments.tgz and zarafadump.sql to backup or move to another server.


Restore
--------

STOP ZARAFA-SERVER
Code: [Select]
service zarafa-server stop
IMPORT ATTACHMENTS
Code: [Select]
mv /var/lib/zarafa /var/lib/zarafaOLD
mkdir /var/lib/zarafa
cd /var/lib/zarafa
tar -zxvf /var/tmp/attachments.tgz
chown root:root -R /var/lib/zarafa

Code: [Select]
cd /var/lib/zarafa
find . -type d -print0 | xargs -0 chmod 0700 # for directories
find . -type f -print0 | xargs -0 chmod 0644 # for files

FIND DATABASE PASSWORD
Code: [Select]
cat /var/lib/zentyal/conf/ebox-zarafa.passwd
IMPORT MYSQLDUMP (this may take a while depending on the size of your DB)
Code: [Select]
mysql -u zarafa -p zarafa < /var/tmp/zarafadump.sql
RESTART ZARAFA-SERVER
Code: [Select]
service zarafa-server start

TOOLS TO REATTACH MISSING STORES
Code: [Select]
zarafa-admin --list-orphans
zarafa-admin --hook-store STOREGUID -u username
zarafa-admin --remove-store STOREGUID
« Last Edit: March 06, 2014, 05:06:02 pm by auerhaan »
Zentyal 2.2.11 on:
Dell Poweredge 2900
2x Quad-Core Xeon E5310 1.6Ghz
16 GB (8x 2 GB)
3x 73 GB SAS (PERC 5/i RAID5)
3x 146 GB SAS (PERC 5/i RAID5)
Broadcom dual gigabit NIC

At the moment migrating to Zentyal 3.3

KonstantinPr

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-1
    • View Profile
Where is the mail stored in the filesystem
« Reply #16 on: November 23, 2015, 10:47:40 am »
Can someone please take me through the steps of how to install PHPVMS please. Im having trouble when it goes to the tables and then i say next step and it doesnt load. Then when i go on the website its half loaded?

I Need Help


Cheers
Myles