Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Squirrelmail Backup and Restore Tutorial?

  1. #1
    Join Date
    Jan 2013
    Beans
    174

    Squirrelmail Backup and Restore Tutorial?

    So I followed this tutorial with success some time back. http://www.howtoforge.com/perfect-se...ot-ispconfig-3 How do I create a backup of squirrelmail data and restore? The only info I have been able to find is posted here http://www.howtoforge.com/forums/showthread.php?t=61116 Is it really that simple to back up all data? Thanks for any and all assistance.

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,571
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Squirrelmail Backup and Restore Tutorial?

    The really important data are the mailboxes. Usually the inboxes are in /var/mail and any personal folders in the users' home directories. SquirrelMail itself resides in /usr/share/squirrelmail. Only the config directory is unique to your site.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jan 2013
    Beans
    174

    Re: Squirrelmail Backup and Restore Tutorial?

    Quote Originally Posted by SeijiSensei View Post
    The really important data are the mailboxes. Usually the inboxes are in /var/mail and any personal folders in the users' home directories. SquirrelMail itself resides in /usr/share/squirrelmail. Only the config directory is unique to your site.
    So I located the mail in /var/vmail/mydomain.com. I do not see any user home directories however. I do see additional data here /var/lib/squirrelmail/data/tuser@mydomain.com.abook and /var/lib/squirrelmail/data/tuser@mydomain.com.pref. Does this seem correct? Thanks.

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,571
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Squirrelmail Backup and Restore Tutorial?

    Those files are the address books and preferences for each user that SquirrelMail maintains. They don't contain any messages.

    The mail itself might be delivered to the users' home directories. Implementations vary depending on the type of delivery system you use, for instance, whether the mail is stored in mbox or Maildir folders. Take a look at /home/username and see if a mail or Maildir exists.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Jan 2013
    Beans
    174

    Re: Squirrelmail Backup and Restore Tutorial?

    Quote Originally Posted by SeijiSensei View Post
    Those files are the address books and preferences for each user that SquirrelMail maintains. They don't contain any messages.

    The mail itself might be delivered to the users' home directories. Implementations vary depending on the type of delivery system you use, for instance, whether the mail is stored in mbox or Maildir folders. Take a look at /home/username and see if a mail or Maildir exists.
    No luck in the home directories but I do see mail folders in

    Code:
    /var/vmail/mydomain.com/tuser/Maildir/.Test Folder/maildirfolder
    This must be it?

  6. #6
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    1,881
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Squirrelmail Backup and Restore Tutorial?

    Look inside that folder or look for Maildir/ folder. Also, dig in deeper until you see some files named like this 1338794060.17775.mail.mydomain.net,S=1767:2,
    That is an actual email filename of a user. You can even view it in the text editor and see the contents. This way, you'll be sure that you are going to copy the correct mail folder.
    You know what solved my problems? GOOGLE Searches!
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe
    The Philippine Team

  7. #7
    Join Date
    Jan 2013
    Beans
    174

    Re: Squirrelmail Backup and Restore Tutorial?

    Quote Originally Posted by nerdtron View Post
    Look inside that folder or look for Maildir/ folder. Also, dig in deeper until you see some files named like this 1338794060.17775.mail.mydomain.net,S=1767:2,
    That is an actual email filename of a user. You can even view it in the text editor and see the contents. This way, you'll be sure that you are going to copy the correct mail folder.
    Thank you nerdtron and Seiji. I found data here:



    Code:
    /var/vmail/mydomain.com/tuser/Maildir/cur#
    Will a simple copy of all folders/subfolders be enough to restore?

    Code:
    cp -r /var/vmail/mydomain.com/
    or this?

    Code:
    cp -r -p /var/vmail/mydomain.com/

  8. #8
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    1,881
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Squirrelmail Backup and Restore Tutorial?

    cp command?
    Is the backup drive and the destination drive on the same computer?

    Also, remember the syntax
    Code:
    cp -r -p [source] [destination]
    You may not need the -p option if the folder is already created but it's good to have.

    In my case, as with recent my migration (from Squirrelmail to iRedMail Roundcube) it's better to use the rsync command. It works even on separate computers on the network (one is the old mail, and the other is the mail server).

    BUT if you are just doing a one time backup and restore, it would be a lot better if you use a zip (or tar) the whole folder. This way, you just unzip the file when you want to restore the emails. The advantage of this it that it preserves file ownership and permissions and saves a lot of hard drive space. I strongly suggest this way since permission on email files are important.
    You know what solved my problems? GOOGLE Searches!
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe
    The Philippine Team

  9. #9
    Join Date
    Jan 2013
    Beans
    174

    Re: Squirrelmail Backup and Restore Tutorial?

    nerdtron I'm going to be using rsync but wasn't sure how to express the command options with it. What's your rsync command?

  10. #10
    Join Date
    Aug 2009
    Location
    Makati City, Philippines
    Beans
    1,881
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Squirrelmail Backup and Restore Tutorial?

    This commmand is issued on the receiving server. Meaning, the copied files will come from remote server.
    Code:
    rsync -avrh --progress  --delete-excluded --delete  root@192.x.x.x:/remote/mail/path/to/Maildirs /local/destination/path/Maildir/
    -avrh - a means to copy attributes, permissions and ownerships, v for verbose to see what is currently copying, r for recursive to copy the inner diretories, and h for human readable format (the file sizes)

    --progress - to show the progress of the whole process

    --delete-excluded and --delete - I used this since I used rsync a lot of times, and the data from the sender changes, some are deleted so I added this to delete the non-existent files from the sender but the were present on the receiver.

    root@192.x.x.x:/path/ - the sender (or rather the SOURCE location), or the old email server and the path to the location you want to copy.

    /local/destination/ - the path on the receiving machine (the DESTINATION) where the copied files will be located.

    You're rsync command may vary, but this will do the trick if you want to copy from one server to another. If you will run rsync just once, do not include --delete-excluded and --delete in the command.
    You can also check the manual for rsync (I read it carefully and tested some commands before doing the real copy).
    Code:
    man rsync
    Keep us updated on your progress.
    Last edited by nerdtron; July 19th, 2013 at 06:53 AM. Reason: just fixed some typos
    You know what solved my problems? GOOGLE Searches!
    The best Ubuntu derivative: Linux Mint
    Relax. Head to the Community Cafe
    The Philippine Team

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •