Re: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Hi Wil, On Fri, 21 Mar 2003 12:25:42 -0800 Wil Hatfield - HVHM Customer Care wrote: I know nothing of strace(). The conversion seems to want to find it at the old path of ~vpopmail/domains/someonesdomain.com/ and it gladly converts if it finds the information there. But of course all of the paths are wrong What I could see from vconvert.c source code it searches the location of vpasswd file in /var/qmail/users/assign. So I'd suggest you - either add the new domain via 'vadddomain' if you switched to a new server and the old directories aren't present - or correct the path in above mentioned file to fit the new location if you're working on the same server and only recompiled vpopmail. vconvert searches a.m. file for correct path, opens 'vpasswd' fiel in this found location and does a 'vdeldomain' followed by a 'vaddomain' and than parses the vpasswd file into 'vadduser' (of course called functions are named a littel bit different, as it uses the API calls directly, the the principle should be shown correctly). So you have to use vconvert of vpopmail compiled with MySQL support, for 'vadddomain' and 'vadduser' being able to add the users to database!!! For security reasons I'd make a backup of old vpopmail directories as well as of database before trying to convert, there are deleting action I don't know of all possible consequences!!! If conversation fails again I'd suggest you send the file produced by strace -o /tmp/vconvert.log -f -s 1024 ~vpopmail/bin/vconvert -c -m -d domain namely the file '/tmp/vconvert.log', as attachment for us being able to inspect what could have went wrong. After all this is done (successfully) you should call 'qmail-newu' to update the qmail-user-cdb file according to qmail-user-assign, which contains the new path(s). Make sure you keep a copy of original 'assign' file as well, in case something went wrong you should copy it back and call qmail-newu, so old paths are prevented. What vpopmail needs is a big picture like Dan has put together for qmail. I think that would be a very valuable resource. Have one that shows the schematic of qmail/vpopmail using .cdb and then one showing qmail/vpopmail using mysql. That would be most informative. ... and showing vpopmail using pgsql, cdb, etc ... simply all types of lookup ... quite big project, which is I assume the reason nobody has done this big picture before :-) -- Ciao, Pit
RE: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Peter, As I suspected vconvert doesn't lookup the location of vpasswd based on assign or any other file for that matter. It only seems to use the vpopmail home directory. Here is the strace segment that tells the story. 2140 read(3, \377\32\4Table \'vpopmail\' already exists, 34) = 34 2140 open(/sites/home/vpopmail/postoffice/hcx.net/vpasswd, O_RDONLY) = -1 ENOENT (No such file or directory) 2140 write(1, converting hcx.net domain conversion failed\n, 44) = 44 2140 exit(0) = ? Of course vpasswd isn't located at /sites/home/vpopmail/ on my new systems. It is under the users directory. If vconvert had a -u switch which we could use to designate the user and thus the users home directory I think vconvert would work great. However it doesn't. If there was a -u switch it could default to ~vpopmail thus keeping to typical configuration. Anybody up for a patch? Wil Hatfield -Original Message- From: Peter Palmreuther [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 5:47 AM To: [EMAIL PROTECTED] Subject: Re: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations Hi Wil, On Fri, 21 Mar 2003 12:25:42 -0800 Wil Hatfield - HVHM Customer Care wrote: I know nothing of strace(). The conversion seems to want to find it at the old path of ~vpopmail/domains/someonesdomain.com/ and it gladly converts if it finds the information there. But of course all of the paths are wrong What I could see from vconvert.c source code it searches the location of vpasswd file in /var/qmail/users/assign. So I'd suggest you - either add the new domain via 'vadddomain' if you switched to a new server and the old directories aren't present - or correct the path in above mentioned file to fit the new location if you're working on the same server and only recompiled vpopmail. vconvert searches a.m. file for correct path, opens 'vpasswd' fiel in this found location and does a 'vdeldomain' followed by a 'vaddomain' and than parses the vpasswd file into 'vadduser' (of course called functions are named a littel bit different, as it uses the API calls directly, the the principle should be shown correctly). So you have to use vconvert of vpopmail compiled with MySQL support, for 'vadddomain' and 'vadduser' being able to add the users to database!!! For security reasons I'd make a backup of old vpopmail directories as well as of database before trying to convert, there are deleting action I don't know of all possible consequences!!! If conversation fails again I'd suggest you send the file produced by strace -o /tmp/vconvert.log -f -s 1024 ~vpopmail/bin/vconvert -c -m -d domain namely the file '/tmp/vconvert.log', as attachment for us being able to inspect what could have went wrong. After all this is done (successfully) you should call 'qmail-newu' to update the qmail-user-cdb file according to qmail-user-assign, which contains the new path(s). Make sure you keep a copy of original 'assign' file as well, in case something went wrong you should copy it back and call qmail-newu, so old paths are prevented. What vpopmail needs is a big picture like Dan has put together for qmail. I think that would be a very valuable resource. Have one that shows the schematic of qmail/vpopmail using .cdb and then one showing qmail/vpopmail using mysql. That would be most informative. ... and showing vpopmail using pgsql, cdb, etc ... simply all types of lookup ... quite big project, which is I assume the reason nobody has done this big picture before :-) -- Ciao, Pit
RE: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Peter, I know nothing of strace(). The conversion seems to want to find it at the old path of ~vpopmail/domains/someonesdomain.com/ and it gladly converts if it finds the information there. But of course all of the paths are wrong Since you obviously know the 'big picture' better than I do maybe you can tell me if this will work. What if I recreate the postmaster account, move the user directories (besides postmaster) and then import user records into the mysql.vpopmail.vpopmail table. Will that work? Is it missing anything? I figure the recreation of postmaster will create the necessary control and assign files and the copy and import into mysql will handle the individual users under the domain. What do you think? What vpopmail needs is a big picture like Dan has put together for qmail. I think that would be a very valuable resource. Have one that shows the schematic of qmail/vpopmail using .cdb and then one showing qmail/vpopmail using mysql. That would be most informative. Wil Hatfield -Original Message- From: Peter Palmreuther [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 11:42 PM To: Wil Hatfield - HVHM Customer Care in vpop Subject: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations Hello Wil, On Friday, March 21, 2003 at 1:15:12 AM you wrote (at least in part): converting someonesdomain.com domain conversion failed I've never actually done such a conversation, so my experiences are limited. But I'd 'strace()' the vconvert process to figure out where (and maybe why) it fails. Perhaps it's only a file it is missing / searching in a different directory?!?!? -- Best regards Peter Palmreuther Always do right. This will gratify some people and astonish the rest. -- Mark Twain --
RE: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Peter, cp -R /sites/home/vpopmail/domains/someonesdomain.com/* /sites/http/somonesdomain.com/postoffice/someonesdomain.com/ vconvert -c -m someonesdomain.com Only results in converting someonesdomain.com domain conversion failed Is there something I have to do before hand that I am not aware of? I can add new domains and they all go where they are supposed to go adding the correct information to /var/qmail/users /var/qmail/control and vpopmail.* but once I get to conversion nothing! And this is a machine with 1 virtual domain. I am already having nightmares about getting to the machine with 250 domains. Thanks for the help, Wil -Original Message- From: Peter Palmreuther [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:31 PM To: Wil Hatfield - HVHM Customer Care in vpop Subject: [vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations Hello Wil, On Wednesday, March 19, 2003 at 8:37:28 PM you wrote (at least in part): I am sure it has already been covered but I couldn't find exactly what I was looking for so here we go again. I need to import from the old cdb version that Vpopmail used to the new MySQL. New to us anyways. The tricky part is that the old user base was located at /sites/home/vpopmail/domains and the new location will be /sites/http/domainname.com/postoffice by using the -u switch. Could someone point me in the direction of a resource that may be modifiable in this fashion? It would be most appreciated. Try copying /sites/home/vpopmail/domains/domain.com/vpasswd* to /sites/http/domainname.com/postoffice/ and use the 'vconvert' tool provided with vpopmail. -- Best regards Peter Palmreuther A real patriot is the fellow who gets a parking ticket and rejoices that the system works.
[vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Hello Wil, On Friday, March 21, 2003 at 1:15:12 AM you wrote (at least in part): converting someonesdomain.com domain conversion failed I've never actually done such a conversation, so my experiences are limited. But I'd 'strace()' the vconvert process to figure out where (and maybe why) it fails. Perhaps it's only a file it is missing / searching in a different directory?!?!? -- Best regards Peter Palmreuther Always do right. This will gratify some people and astonish the rest. -- Mark Twain --
[vchkpw] Re: Best Way To Import cdb to MySQL w/ Alterations
Hello Wil, On Wednesday, March 19, 2003 at 8:37:28 PM you wrote (at least in part): I am sure it has already been covered but I couldn't find exactly what I was looking for so here we go again. I need to import from the old cdb version that Vpopmail used to the new MySQL. New to us anyways. The tricky part is that the old user base was located at /sites/home/vpopmail/domains and the new location will be /sites/http/domainname.com/postoffice by using the -u switch. Could someone point me in the direction of a resource that may be modifiable in this fashion? It would be most appreciated. Try copying /sites/home/vpopmail/domains/domain.com/vpasswd* to /sites/http/domainname.com/postoffice/ and use the 'vconvert' tool provided with vpopmail. -- Best regards Peter Palmreuther A real patriot is the fellow who gets a parking ticket and rejoices that the system works.