{"id":72,"date":"2019-10-25T02:19:35","date_gmt":"2019-10-25T02:19:35","guid":{"rendered":"http:\/\/metajack.org\/blog\/?p=72"},"modified":"2019-11-06T21:32:45","modified_gmt":"2019-11-06T21:32:45","slug":"moving-vpopmail-directories","status":"publish","type":"post","link":"https:\/\/metajack.org\/blog\/2019\/10\/25\/moving-vpopmail-directories\/","title":{"rendered":"Moving vpopmail directories"},"content":{"rendered":"\n<p>For years I have somehow thought moving vpopmail domains between vpopmail installs was hard (ie. from one server to another). I even went so far as to custom build vadddomain binaries which forced creation to a particular directory (ie: \/home\/vpopmail\/domains\/0\/, \/home\/vpopmail\/domains\/1\/). <\/p>\n\n\n\n<p>If you are not familiar with the &#8220;problem&#8221; it is that in larger installs vpopmail balances the mail directories among subdirs in ~vpopmail\/domains. If all your domains are in a single directory (~vpopmail\/domains) you are fine &#8211; just vadddomain on the new machine then rsync the data directories. The problem arises when you vadddomain on the new install and it assigns a different directory on the new server than on the old one.<\/p>\n\n\n\n<p>Because qmail stores much of the mapping in cdb databases I somehow began thinking it would be a lot of work to update these. I was wrong. It is actually quite easy. First, tar up the users dir on the source server :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/\ntar czpf \/root\/backup.tgz \/home\/vpopmail\/domains\/2\/whatever.org<\/code><\/pre>\n\n\n\n<p>On the new server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~vpopmail\/bin\/vadddomain whatever.org\ncd \/\nwget http:\/\/whatever.org\/backup.tgz\ntar xzpf backup.tgz<\/code><\/pre>\n\n\n\n<p>Edit \/var\/qmail\/users\/assign &#8211; vadddomain likely created the new install using a different subdirectory.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>emacs \/var\/qmail\/users\/assign\n# edit the directory the domain maps to (should be the last line in the file)\n\/var\/qmail\/bin\/qmail-newu<\/code><\/pre>\n\n\n\n<p>Confirm all is well with a vdominfo on the new server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~vpopmail\/bin\/vdominfo whatever.org<\/code><\/pre>\n\n\n\n<p>This should show the &#8220;old&#8221; vpopmail directory that you copied over. As always send a test to make sure all is well. Start with a local test before updating DNS, if the test is delivered correctly, update DNS and test remotely.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For years I have somehow thought moving vpopmail domains between vpopmail installs was hard (ie. from one server to another). I even went so far as to custom build vadddomain binaries which forced creation to a particular directory (ie: \/home\/vpopmail\/domains\/0\/, \/home\/vpopmail\/domains\/1\/). If you are not familiar with the &#8220;problem&#8221; it is that in larger installs &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/metajack.org\/blog\/2019\/10\/25\/moving-vpopmail-directories\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Moving vpopmail directories&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-sysadmin","entry"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":4,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/72\/revisions\/84"}],"wp:attachment":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}