Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: NaN on June 22, 2006, 09:53:25 PM
-
I have been trying to upgrade my sme server 6.01 to 7.0rc3 for 2 days now and although nearly there I have a problem migrating email across.
My 6.01 configuration included quite a few contribs so I did a completely fresh install of 7.0 and tried to restore the 6.01 backup following the procedure described elsewhere in these forums. But no matter what I did I ended up with a mess.
So after all that I have resorted to reconfiguring everything from scratch. There are only 7 users so it is not too much trouble. So now I have the new server set up with the users configured. I've copied across (manually) their files, no problem, but I cannot manually migrate the email. :-(
Copying the emails manually from the old .../Maildir folder to the new one on the new installation leaves imap completely broken and the email client is unable to see any of the email headers, dates, or any folders.
Can someone please give me a tip for migrating the email across manually?
Thanks
David.
-
Interesting - it seems that all the folders in Maildir are named with semicolon separators. For example ";INBOX". If I change the semi-colons to fullstops and ensure that the permissions are correct my email client sees the folders and files ...
David.
-
Had to extract these files from a failed hard drive. Went through the same learning experience as you.
Here's my notes:
Convert emails
Enter mc
Copy old folder and rename with period instead of semicolon. Uncheck retain attributes. Uncheck dive into subdirs if exists
Move to users home directory
/etc/e-smith/files/users/username
chown -R name:name ./Maildir
Enter mc and copy dovecot-uidlist username directory
-
Interesting - it seems that all the folders in Maildir are named with semicolon separators. For example ";INBOX". If I change the semi-colons to fullstops and ensure that the permissions are correct my email client sees the folders and files ...
I'm going through the same process, and noticed that:
a) None of my IMAP sub-folders contains mail
b) The [empty] sub-folders contained semi-colons in my mail client
c) Folders that originall contained full stops (e.g. my 'contribs.org' folder) got split into sub-folders (e.g. contribs->org)
So, given those 'clues' I am also thinking of changing the semi-colons to full stops. A quick question: did you change ALL the semi-colons, or did you leave the initial (e.g. ";archive;2002" to ";archive.2000" or ".archive.2002")? I suspect the initial semi-colon should be left, but I'm not sure.
Is this a general problem for all upgrades 6.0.1->7.x, or is it related to specific contributions? I can't find anything in the bug tracker, which makes me think it is not a general problem, but perhaps no-one has tested migrating a complex structure of IMAP folders yet?
Any hints appreciated (and I'll raise a bug if it looks like it is one).
-- JJ
-
This shell script will rename all the folders in a Maildir for you:
# List only directories starting with a semi-colon
# Be aware too that directories may contain spaces
ls -d1 ';'* | (
while read DIR
do
# Convert any existing '.'s to a '-' then any ';'s to a '.'
NEWDIR=echo $DIR | awk '{gsub("[.]", "-"); gsub("[;]", "."); print $0}'
# Don't try and rename if the destination directory already exists
if test -f "$NEWDIR"
then
echo "Cannot rename '$DIR' - directory '$NEWDIR' already exists"
else
echo "Rename '$DIR' to '$NEWDIR'"
mv "$DIR" "$NEWDIR"
fi
done
)
After renaming the IMAP folders, you will need to reboot the server and restart your mail client. If you want to automate it a little more, a further loop will allow it to rename all folders in all user accounts in one go.
I am very unclear as to whether the backup restore process should have done this automatically. It either does not, or is supposed to and does not work.
-- JJ
-
I've got the same problem.
I renamed every ;INBOX to .INBOX but still no mail.
I checked the rights and the username is owner name and groupname. I have no idea what the problem could be.
I really need some of the mail back.
I also had a diskcrash, but could retain the userfolders and some others.
I upgraded to sme7 from sme6.5 everything works except mail, can anybody help me?
-
I rsynced (with a --delete) v6 Maildir (imap) folders to a v7 box and ran this modifed version of the above script as follows:
#!/bin/bash
IFS=$'\n'
for DIR in `ls -d1 ';'*`
do
# Convert any existing '.'s to a '-' then any ';'s to a '.'
NEWDIR=`echo $DIR | awk '{gsub("[.]", "-"); gsub("[;]", "."); print $0}'`
# Don't try and rename if the destination directory already exists
if test -f "$NEWDIR"
then
echo "Cannot rename '$DIR' - directory '$NEWDIR' already exists"
else
echo "Rename '$DIR' to '$NEWDIR'"
mv "$DIR" "$NEWDIR"
fi
done
it seemed to work fine
hope this helps someone
cheers
mark
-
I rsynced (with a --delete) v6 Maildir (imap) folders to a v7 box and ran this modifed version of the above script as follows:
Could you raise this in the bug tracker please?
A "signal-event post-upgrade; signal-event reboot" will rename all folders correctly from ; format to . form. However, the idea of renaming folder names containing . to - form first is a good one. Otherwise you end up with subfolders.
For the record, we used ; as a separator specifically so that . would be allowed in folder names. However, this is non-standard and means we had to keep patching dovecot to support this non-standard behaviour. This caused pain for other add-ons, so we reverted to the standard . folder separator in SME7.0