Thanks Pak. My initial thought was to try to export the valias table
from the vpopmail database, and import it on the new server, however I
wasn't sure if that would work/be a good idea considering the fact that
I'm migrating the domains individually, because of the way the old
server's vpopmail is built, and the fact that vpopmail is installed on
/u1 on the old system, opposed to /home/vpopmail on the new one, and
last but not least, I wanted to play it safe.
What I ended up doing modifying the valias2dotqmail script I found on
the qmailtoaster wiki so that it created the .qmail-alias files in an
"aliases" folder in abc.com's root folder, and then I copied the
contents of that folder to the new server - wrote a script of my own
that used sed to search through the files and replace the /u1 path with
/home/vpopmail. This last step I haven't tested yet, but will be giving
it a shot tonight: using the dotqmail2valias program that is included
with vpopmail. It looks like it should work, so we'll see.
Oh and I solved my problem with the mailing lists...I realized that
after migrating a domain, all of the symlinks that were previously
created in the domain's root directory were pointing to the old path,
and it was going to be a hassle to have to manually recreate and edit
each one...so I wrote a script for that as well...I was actually quite
impressed with myself, because my scripting skills are limited at best.
--------
#!/bin/bash
# Created by Casey James Price -- (09/28/2011)
# Smile Global -- POP Server Migration Project -- fix-links.sh
# This script fixes the mailing list symlinks that were created when the
domain was migrated
# Replaces '/u1' with '/home/vpopmail'
# Use 'find' in a for loop to locate the bad symlinks, and then readlink
to show the destinaton of the actual file.
# Pipe the output to sed and do a regexp search/replace. Store this
value as 'x', and call 'ln' to recreate
# the symlink using '$x' as the destination and '$a' as the link name.
Use sed again to replace the old domain path
# inside of the file itself. Lastly, 'chown -R vpopmail.vchkpw $a'
for a in `find /home/vpopmail/domains/smileglobal.com -type l`;
do
x=`readlink $a | sed 's/u1/home\/vpopmail/'`
ln -nsf $x $a
`sed -i 's/u1/home\/vpopmail/g' $x`
`chown -R vpopmail.vchkpw $a`
done
-------
Casey
Smile Global Technical Support
Submit or check trouble tickets http://billing.smileglobal.com
www.smileglobal.com <http://www.smileglobal.com>
On 9/30/11 12:44 AM, Pak Ogah wrote:
On 09/29/11 15:29, Casey wrote:
Here is the next thing I'm not sure about...what is the best way for
me to re-create all of the user aliases? Looks like they are all
stored in the database on the old server, but is there an easy way
that I can "import" them?
you can easily export import vpopmail mysql database using my previous
howto,
or just using heidisql by connecting to both server