<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UNIXy &#187; hosting</title>
	<atom:link href="http://blog.unixy.net/tag/hosting/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unixy.net</link>
	<description>Fully Managed Dedicated Servers</description>
	<lastBuildDate>Sun, 18 Dec 2011 07:23:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>UNIXy is expanding in Europe and North Africa</title>
		<link>http://blog.unixy.net/2011/10/unixy-is-expanding-in-europe-and-north-africa/</link>
		<comments>http://blog.unixy.net/2011/10/unixy-is-expanding-in-europe-and-north-africa/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 06:02:34 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Challenge]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[europe]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[managed]]></category>
		<category><![CDATA[north africa]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[UNIXy]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=1436</guid>
		<description><![CDATA[I am proud to pre-announce our strategic expansion of Web hosting operations in Europe and in North Africa. Taking on this initiative is consistent with our vision to become a world-wide player in the managed server arena. More information will become available soon.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F10%2Funixy-is-expanding-in-europe-and-north-africa%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2011%2F10%2Funixy-is-expanding-in-europe-and-north-africa%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I am proud to pre-announce our strategic expansion of <a title="Web hosting" href="http://www.unixy.net">Web hosting</a> operations in Europe and in North Africa. Taking on this initiative is consistent with our vision to become a world-wide player in the <a title="managed server" href="http://www.unixy.net">managed server</a> arena. More information will become available soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2011/10/unixy-is-expanding-in-europe-and-north-africa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Know when to upgrade memory, CPU, Disk, or bandwidth!</title>
		<link>http://blog.unixy.net/2009/03/know-when-to-upgrade-memory-cpu-disk-or-bandwidth/</link>
		<comments>http://blog.unixy.net/2009/03/know-when-to-upgrade-memory-cpu-disk-or-bandwidth/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 23:15:15 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Crash Course]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[kSar]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[mpstat]]></category>
		<category><![CDATA[SAR]]></category>
		<category><![CDATA[swap]]></category>
		<category><![CDATA[sysstat]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vmstat]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=5</guid>
		<description><![CDATA[Disclaimer: this post covers Linux only. The installation steps will also only work with Linux Redhat and Debian derivatives. They can be made to work with other Linux and Unix flavors as well. What Is This Post About There are times when one can&#8217;t tell what is it that&#8217;s causing their server (as in VPS [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F03%2Fknow-when-to-upgrade-memory-cpu-disk-or-bandwidth%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2009%2F03%2Fknow-when-to-upgrade-memory-cpu-disk-or-bandwidth%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Disclaimer</strong>: this post covers Linux only. The installation steps will also only work with Linux Redhat and Debian derivatives. They can be made to work with other Linux and Unix flavors as well.</p>
<p><strong><span style="text-decoration: underline;">What Is This Post About</span></strong></p>
<p>There are times when one can&#8217;t tell what is it that&#8217;s causing their server (as in VPS or dedicated server) to perform poorly. This post will hopefully help someone make an educated decision on whether to proceed with an upgrade or not. At least, it will help someone find the culprit and act accordingly.</p>
<p><strong><span style="text-decoration: underline;">The Basics First</span></strong></p>
<p>There are mainly four components that can make or break server responsiveness. Those are hard disk, memory, CPU, and bandwidth. It only takes one weak component to cause a server to be unresponsive. Linux provides tools that help visualize and pinpoint the lowest performing component(s). The tools are somewhat analogically similar to a car dashboard. You can tell whether the car is running out of gas or if the engine temperature is higher than usual. etcetera. Ultimately, one can correlate component weakness with server responsiveness.</p>
<p>So, what makes a server sluggish? Is it the lack of memory or the lack of CPU cycles? It could be either, neither, or both. It&#8217;s essential to realize that there are so many jobs a CPU can run before it&#8217;s pegged. Hard disks can only take so many requests before it saturates. As the components are fed more work than they can handle, the system starts queueing jobs. The queuing of jobs is one of the earliest signs of a server that has reached capacity.</p>
<p><strong><span style="text-decoration: underline;">Introducing The Dashboard</span></strong></p>
<p>How do we catch the early signs of a busy server? Unfortunately, and for a non-maintained server, user complaints is one of the earliest signs. There&#8217;s no doubt that we need to be proactive and on the lookout. There&#8217;s the great Top tool but it doesn&#8217;t provide a holistic view of what&#8217;s cooking on the srever. The good news is that there&#8217;s a tool that will do all the mundane work for us, all day long unattended. And from the comfort of your home once a day or once a week, you can go over the collected information.</p>
<p>My favorite tool is SAR, which stands for System Activity Reports. SAR is a collection of programs that run in the background on minimal resources and silently collect vital system data. It collects hard disk, CPU, memory, network information, and much more. While the SAR command line tools are all you need to display the data, there&#8217;s a bit of a learning curve to it. But don&#8217;t be discouraged; there are other ways, besides the command line, to display the data. We&#8217;ll go over an example later on.</p>
<p>So, let&#8217;s get SAR up and running. For those that have skipped the disclaimer, this tutorial deals with Linux Redhat and Debian compatible installs only. Therefore, it may or may not work with all Linux distributions. The following instructions require that you remote into the server. You should have a shell / command line open and ready for your input.</p>
<p><strong><span style="text-decoration: underline;">Installing SAR</span></strong></p>
<p><strong>ON DEBIAN</strong></p>
<p>As root, install the sysstat package by executing the following command as root:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">apt-get install sysstat</td>
</tr>
</tbody>
</table>
</div>
<p>Edit the file /etc/default/sysstat and change the line:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">ENABLED=&#8221;false&#8221;</td>
</tr>
</tbody>
</table>
</div>
<p>To:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">ENABLED=&#8221;true&#8221;</td>
</tr>
</tbody>
</table>
</div>
<p>No action is required on your part if it&#8217;s already set to true. Also, edit the file /etc/sysstat/sysstat and set the variable HISTORY to however many days you want SAR to keep historical data:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">HISTORY=7</td>
</tr>
</tbody>
</table>
</div>
<p>To</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">HISTORY=31</td>
</tr>
</tbody>
</table>
</div>
<p>And last, kick off the process:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">/etc/init.d/sysstat restart</td>
</tr>
</tbody>
</table>
</div>
<p><strong>ON REDHAT</strong></p>
<p>Install the sysstat tools</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">yum install sysstat</td>
</tr>
</tbody>
</table>
</div>
<p>Edit the /etc/sysconfig/sysstat file and change the variable HISTORY as such:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">HISTORY=7</td>
</tr>
</tbody>
</table>
</div>
<p>To</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">History=31</td>
</tr>
</tbody>
</table>
</div>
<p>Then restart sysstat:</p>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Quote:</div>
<table border="0" cellspacing="0" cellpadding="6" width="100%">
<tbody>
<tr>
<td class="alt2" style="border: 1px inset;">service sysstat restart</td>
</tr>
</tbody>
</table>
</div>
<p>That&#8217;s all you have to do on the server side. We&#8217;ll have to let SAR run for a few hours and let it collect data.</p>
<p><strong><span style="text-decoration: underline;">The Fun Part</span></strong></p>
<p>This is the part where we get to see the data in pretty graphs and charts! A tool that goes with the name kSar, and that you can download for free, will itself remote into your server, download the SAR-generated files, and neatly graph them for you. This is the best tool I have found so far. Simply point your browser to <a href="http://sourceforge.net/project/showfiles.php?group_id=179805&amp;package_id=207768&amp;release_id=645912" target="_blank">http://sourceforge.net/project/showf&#8230;ease_id=645912</a> and hit the download link. Unzip the file, and double click on the JAR file. Once the application has launched, select the &#8220;Data&#8221; option in the menu, then &#8220;Launch SSH Command&#8221;. Input your server parameters (Ex: <a href="mailto:root@vpslux.com">root@vpslux.com</a>:22). Finally, select &#8220;Yes&#8221; when prompted for running the command &#8220;sar -A&#8221;. I&#8217;ve attached some screenshots of kSar in action. kSar has a shortcoming, however. It only displays one day worth of data at a time. But you can always save the daily reports as a PDF file and view them at a later date.</p>
<p><strong><span style="text-decoration: underline;">Back To Work!</span></strong></p>
<p>Let&#8217;s make some sense out of those graphs. Of interest are the following panel tabs: <em>CPU all</em>, <em>Swapping</em>, <em>Memory Usage</em>, <em>Load</em>, <em>Processes</em>, <em>Paging Activity</em>, <em>Sockets</em>, and finally <em>Interface traffic</em> under the Interface tab. We can group <em>Swapping</em>, <em>Memory Usage</em>, and <em>Paging Activity</em> together under the same category as they&#8217;re correlated to an extent. <em>CPU all</em>, <em>Sockets</em> and <em>Interface traffic</em> can be regarded as two independent indicators.</p>
<p>About 99% of the time, <em>Sockets</em> and <em>Interface traffic</em> are leading indicators in the sense that the number of open sockets and traffic increases as soon as the node in question sees more traffic as a result of user visits. <em>CPU all</em> shows the amount of CPU used over time. You can ignore short, occasional spikes. But sustained usage of 90% and above for periods of time is usually a sign of pegged CPUs. It&#8217;s most likely time to upgrade the CPUs or dig further into what&#8217;s hogging CPU. <em>Swapping</em> is the next most interesting indicator to look at. Any spikes here are usually a sign of lack of free memory. Let&#8217;s select <em>Memory Usage</em> to confirm. If <em>Memory Usage</em> is anywhere less than roughly 4MB over extended periods of time, then the box is begging for a memory upgrade (in conjunction with <em>Swapping</em> indicator). <em>Paging</em>, and in particular a spike in page faults, can further confirm the lack of memory.</p>
<p>To recap, and in general, interface traffic and therefore number of sockets increase, which leads to resources being consumed in order to serve data. The latter then causes either memory, CPU, or both to spike up, which then might cause swapping (disk I/O). One might suggest improving disk I/O but swapping is only a symptom of the issue. In this scenario, the lack of memory is definitely the root cause of the issue. But keep in mind that there are scenarios when disk I/O spikes up while memory is plenty available on the system. This is an easy case to resolve as most likely a rogue process is hitting the disks more than it should. One last scenario is when CPU, memory, and disk I/O are all almost flat but responsiveness is sluggish. In this case, pay close attention to the Interface traffic and Interface errors graphs for either saturation of your allocated port speed or errors.</p>
<p>That&#8217;s all folks. Feel free to reply back with questions, comments, corrections.<br />
<img class="aligncenter" src="http://www.webhostingtalk.com/attachment.php?attachmentid=14494&amp;d=1237959455" alt="CPU All" /></p>
<p><img class="aligncenter" src="http://www.webhostingtalk.com/attachment.php?attachmentid=14495&amp;d=1237959455I" alt="Disk Usage I/O" /></p>
<p><img class="aligncenter" src="http://www.webhostingtalk.com/attachment.php?attachmentid=14496&amp;d=1237959455" alt="Memory Usage" /></p>
<p><img class="aligncenter" src="http://www.webhostingtalk.com/attachment.php?attachmentid=14497&amp;d=1237959479" alt="Paging Activity" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2009/03/know-when-to-upgrade-memory-cpu-disk-or-bandwidth/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Web application migration</title>
		<link>http://blog.unixy.net/2008/10/web-application-migration/</link>
		<comments>http://blog.unixy.net/2008/10/web-application-migration/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 02:13:53 +0000</pubDate>
		<dc:creator>UNIXy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[imapcopy]]></category>
		<category><![CDATA[imapsync]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[suction]]></category>

		<guid isPermaLink="false">http://blog.unixy.net/?p=4</guid>
		<description><![CDATA[This is part one of a series of guides on how to perform a proper migration of a Web application. Proper because the goal is to seamlessly and preparedly switch over to a new server or provider. We'll set the bar high enough to only allow room for a 5-10 minutes of cumulative downtime.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.unixy.net%2F2008%2F10%2Fweb-application-migration%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.unixy.net%2F2008%2F10%2Fweb-application-migration%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>UNIXy has experience with migrating server applications in and out for customers. This is one of the value-add services we provide to our customers as they switch over to using our services. We are happy to share our ways of performing these tasks. Migrations are done differently in the industry and this is our proven and preferred method. We would like to hear from you about your ways so don&#8217;t hesitate to share them with us.</p>
<p>This is part one of a series of guides on how to perform a proper migration of a Web application. Proper because the goal is to seamlessly and preparedly switch over to a new server or provider. We&#8217;ll set the bar high enough to only allow room for a 5-10 minutes of cumulative downtime. Note that our experience is limited to Web applications residing on UNIX and/or Linux servers. Also, we are not covering the migration of Web applications that are part of a control panel such as cPanel, Plesk, or DirectAdmin. Control panels have their own migration tools. This guide, however, can assist in migrating a cPanel account over to a non-cPanel server and vice-versa.</p>
<p>While this proposed migration method might seem like a one-time process, it&#8217;s imperative to perform dry runs prior to the actual cut-over. Dry runs do not involve downtime at all and can thus help gauge the terrain for potential issues that may arise on go-live day. We call them exercises!</p>
<p><strong>Web Application Migration Part I &#8211; Email suction</strong></p>
<p>Email is one the most dreaded services to migrate because of the complexity involved. Not only is it our goal to have the new server send and receive email but also mirror the users&#8217; email inboxes and folders as they were prior to the cutoff. Post-migration, users should wake up to their good old familiar inbox in the undergarment of the new server.</p>
<p>There are tools that one needs to equip herself to carry out an email migration; also commonly called suction in the industry. Our preferred tools are Imapcopy, the venerable Imapsync, and a multi-purpose Linux workstation with the GNU tools; but most importantly, a well seasoned systems administrator. As the saying goes: A cowl does not make a monk.</p>
<p>First things first: gather as much information on the current server as possible. Does the server allow direct IMAP access to users? Is it Webmail only? What about POP access? What is the mailbox / user count on the server? Is there a quota for disk space usage? What is the largest mailbox? Suction and IMAP go hand in hand. It&#8217;s only through the IMAP protocol that one can fully interact with a mailbox and its folders. This writeup will not over the nuts and bolts of IMAP or other protocols so be sure to read up on those before continuing.</p>
<p>Imapcopy allows one to copy a mailbox from one server to another using the IMAP protocol. This tool is useful as part of our drill exercises. Before we demo these tools, ensure that an IMAP daemon is listening on both the source and destination.Also, make sure that ports 143 on both the source and destination are open (telnet server 143). Then, download Imapcopy on your workstation. It&#8217;s also time to pick an existing mailbox (preferably one with multiple folders) for our trials.</p>
<p>The Imapcopy utility comes packaged with a sample configuration file. For the purpose of this demo, the changes are good enough for a successful run. We&#8217;re using our Linux workstation as the actual destination server. Here&#8217;s a diff of the changes we made (the symbols &lt; and &gt; and / or spaces were added to avoid getting spam on these inboxes once this page gets crawled):</p>
<blockquote><p><strong>&#8212; ImapCopy.cfg.orig   2008-07-12 23:39:12.000000000 -0500<br />
+++ ImapCopy.cfg        2008-07-13 09:50:52.000000000 -0500<br />
@@ -1,7 +1,7 @@<br />
##############<br />
# Sourceserver<br />
##############<br />
-SourceServer localhost<br />
+SourceServer unixy.net<br />
SourcePort 143</strong></p>
<p><strong>###################<br />
@@ -51,6 +51,6 @@<br />
# List of users and passwords<br />
#############################<br />
#       SourceUser    SourcePassword   DestinationUser DestinationPassword<br />
-Copy    &#8220;foo&#8221;         &#8220;foosrcpw&#8221;       &#8220;foo&#8221;           &#8220;foodestpw&#8221;<br />
-Copy    &#8220;bar&#8221;         &#8220;barsrcpw&#8221;       &#8220;bar&#8221;           &#8220;test&#8221;<br />
+Copy    &#8220;null &lt;@&gt;unixy.net&#8221;         &#8220;XXXXX&#8221;       &#8220;null&#8221;           &#8220;XXXXX&#8221;<br />
+# Copy    &#8220;bar&#8221;         &#8220;barsrcpw&#8221;       &#8220;bar&#8221;           &#8220;test&#8221;</strong></p></blockquote>
<p>From the above sample configuration file, we are instructing Imapcopy to suction mailbox null &lt;@&gt;unixy.net. But before running the suction, we need to test connectivity and authentication between the &#8220;SourceServer&#8221; and &#8220;DestinationServer&#8221;. The flag &#8220;-i&#8221; of imapcopy achieves this connectivity test:</p>
<blockquote><p><strong>$ imapcopy -i<br />
IMAPCopy 1.03 &#8211; 2005/04/20 [compiled with FreePascal] (c) 2001-2006 Armin Diehl &lt;armin@freepascal.org&gt;<br />
Running on Linux</strong></p>
<p><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Login on sourceserver as null &lt;@&gt;unixy.net OK<br />
Login on destinationserver as null OK<br />
Sourceserver:<br />
=============<br />
Server-Info          : [CAPABILITY IMAP4rev1 UIDPLUS<br />
CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT<br />
THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION<br />
STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double<br />
Precision, Inc.  See COPYING for distribution information.<br />
Capabilities         : IMAP4REV1 UIDPLUS CHILDREN<br />
NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION<br />
Personal Namespace   : INBOX<br />
Folder sperator      : .<br />
other Users Namespace:<br />
Public Namespace     : #shared<br />
Folders to copy      : ALL<br />
Skip this folders    : NONE</strong></p>
<p><strong>Destinationserver:<br />
==================<br />
Server-Info          : [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT<br />
THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION]<br />
Courier-IMAP ready. Copyright 1998-2005 Double Precision,<br />
Inc.  See COPYING for distribution information.<br />
Capabilities         : IMAP4REV1 UIDPLUS CHILDREN<br />
NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT<br />
QUOTA IDLE ACL ACL2=UNION<br />
Personal Namespace   : INBOX<br />
Folder sperator      : .<br />
other Users Namespace:<br />
Public Namespace     : #shared</strong></p></blockquote>
<p>So far so good. Now let&#8217;s have it copy the null &lt;@&gt;unixy. net mailbox in its entirety. But before we do that, Imapcopy requires the default layout of a Maildir exists as such:</p>
<blockquote><p><strong>$ mkdir -p /home/null/Maildir/{cur,tmp,new}</strong></p></blockquote>
<p>And now we launch Imapcopy for the full copying of the mailbox:</p>
<blockquote><p><strong>$ imapcopy<br />
IMAPCopy 1.03 &#8211; 2005/04/20 [compiled with FreePascal] (c) 2001-2006 Armin Diehl &lt;armin@freepascal.org&gt;<br />
Running on Linux</strong></p>
<p><strong>Login on sourceserver as null &lt;@&gt;unixy.net OK<br />
Login on destinationserver as null OK<br />
Getting folderlist on sourceserver OK, found 1 folder<br />
Getting List of messages in &#8220;INBOX&#8221; OK, 2 Messages found<br />
Processing Folder INBOX<br />
S:A0004 SELECT INBOX\r\n<br />
R:* FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)\r\n<br />
R:* OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited\r\n<br />
R:* 0 EXISTS\r\n<br />
R:* 0 RECENT\r\n<br />
R:* OK [UIDVALIDITY 1215995880] Ok\r\n<br />
R:* OK [MYRIGHTS "acdilrsw"] ACL\r\n<br />
R:A0004 OK [READ-WRITE] Ok\r\n<br />
S:A0005 APPEND INBOX (\Seen) &#8220;14-Jul-2008 21:46:39 -0500&#8243; {903}\r\n<br />
R:+ OK\r\n<br />
C: Command exit because of + (&#8220;+ OK&#8221;)<br />
S: Message not shown (903 Bytes)<br />
R:A0005 OK [APPENDUID 1215995880 9] APPEND Ok.\r\n<br />
S:A0006 APPEND INBOX (\Seen) &#8220;14-Jul-2008 21:47:25 -0500&#8243; {716}\r\n<br />
R:+ OK\r\n<br />
C: Command exit because of + (&#8220;+ OK&#8221;)<br />
S: Message not shown (716 Bytes)<br />
R:A0006 OK [APPENDUID 1215995880 10] APPEND Ok.\r\n<br />
2 Messages copied, 0 Errors<br />
S:A0007 LOGOUT\r\n<br />
R:* BYE Courier-IMAP server shutting down\r\n<br />
R:A0007 OK LOGOUT completed\r\n<br />
S:A0008 LOGOUT\r\n<br />
C: Command status 1</strong></p>
<p><strong>1 User processed, 2 Messages copied, 0 Error(s)<br />
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied</strong></p></blockquote>
<p>All good! As you can see from the above log, Imapcopy suctioned 2 messages for one user, null &lt;@&gt;unixy.net in this case. One extra step:</p>
<blockquote><p><strong>$ ls -al /home/null/Maildir/cur/<br />
total 16<br />
drwxr-xr-x 2 null null 4096 2008-07-14 21:48 .<br />
drwxrwxrwx 6 null null 4096 2008-07-13 19:38 ..<br />
-rw-r&#8211;r&#8211; 1 null null  695 2008-07-14 21:47 1216090136.M168971P8436V0000000000000305I00175CCF_1.MUX,S=695:2,S<br />
-rw-r&#8211;r&#8211; 1 null null  874 2008-07-14 21:46 1216090136.M30165P8436V0000000000000305I00175CCD_0.MUX,S=874:2,S</strong></p></blockquote>
<p>Impeccable! While Imapcopy could potentially be used to carry out the migration, it is not the prefered method of suction. If it were to be used as part of a migration strategy, one would have to batch all the user mailboxes in one fell swoop. It makes the process time consuming and causes downtime especially when you have to transfer very large mailboxes. Imapcopy&#8217;s copying mechanism is also not incremental or retriable and that is a valid concern. Every time Imapcopy runs, it copies the mailbox in its entirety regardless. Here&#8217;s an example of a re-run. For brevity&#8217;s sake, we&#8217;re only showcasing the statistics of the run:</p>
<blockquote><p><strong>$ imapcopy<br />
Login on sourceserver as null@unixy.net OK<br />
Login on destinationserver as null OK<br />
.<br />
.<br />
.<br />
1 User processed, &lt;b&gt;2 Messages copied&lt;/b&gt;, 0 Error(s)<br />
0 Folder(s) created, 0 Folder create errors, 0 Folder not copied</strong></p></blockquote>
<p>Indeed, Imapcopy has no notion of incremental copying. You could see how it can get out of control with a large mailbox.</p>
<p>The goal here is to suction email messages per-user as they login into the new server for the first time. This is where Imapsync comes in. You supply the source and destination server, the mailbox to sync, and the password of the user&#8217;s mailbox for both the source and destination; imapsync does the rest.</p>
<p>First, let&#8217;s sync our IMAP mail box manually to test the waters:</p>
<blockquote><p><strong>$ imapsync &#8211;host1 unixy.net &#8211;user1 null &lt;@&gt;unixy.net &#8211;password1 XXXXX &#8211;host2 localhost &#8211;user2 null &#8211;password2 XXXXX<br />
$RCSfile: imapsync,v $ $Revision: 1.219 $ $Date: 2007/04/04 09:32:20 $<br />
Here is a linux system Linux MUX 2.6.20-16-server #2 SMP Tue Dec 18 05:52:19 UTC 2007 i686)<br />
with perl 5.8.8<br />
Mail::IMAPClient version used here is 2.2.9<br />
Command line used :<br />
/usr/bin/imapsync &#8211;host1 unixy.net &#8211;user1 null &lt;@&gt;unixy.net &#8211;password1 XXXXX &#8211;host2 localhost &#8211;user2 null &#8211;password2 XXXXX<br />
will try to use CRAM-MD5 authentication on host1<br />
will try to use CRAM-MD5 authentication on host2<br />
From imap server [unixy.net] port [143] user [null &lt;@&gt;unixy.net]<br />
To   imap server [localhost] port [143] user [null]<br />
Banner : * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN<br />
NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT<br />
QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready.<br />
Copyright 1998-2005 Double Precision, Inc.  See COPYING<br />
for distribution information.<br />
Host unixy.net says it has NO CAPABILITY for AUTHENTICATE CRAM-MD5<br />
Error login : [unixy.net] with user [null &lt;@&gt;unixy.net] auth [CRAM-MD5]: 3 NO Login failed.</strong></p>
<p><strong>Trying LOGIN Auth mechanism on [unixy.net] with user [null &lt;@&gt;unixy.net]<br />
Success login on [unixy.net] with user [null &lt;@&gt;unixy.net] auth [CRAM-MD5]<br />
Banner : * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN<br />
NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT<br />
QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready.<br />
Copyright 1998-2005 Double Precision, Inc.  See COPYING<br />
for distribution information.<br />
Host localhost says it has NO CAPABILITY for AUTHENTICATE CRAM-MD5<br />
Error login : [localhost] with user [null] auth [CRAM-MD5]: 3 NO Login failed.</strong></p>
<p><strong>Trying LOGIN Auth mechanism on [localhost] with user [null]<br />
Success login on [localhost] with user [null] auth [CRAM-MD5]<br />
From capability : QUOTA STARTTLS NAMESPACE IDLE<br />
THREAD=ORDEREDSUBJECT ACL SORT UIDPLUS CHILDREN<br />
ACL2=UNION IMAP4REV1 THREAD=REFERENCES<br />
To   capability : QUOTA STARTTLS NAMESPACE IDLE<br />
THREAD=ORDEREDSUBJECT ACL SORT UIDPLUS CHILDREN<br />
ACL2=UNION IMAP4REV1 THREAD=REFERENCES<br />
From state Authenticated<br />
To   state Authenticated<br />
From separator and prefix : [.][INBOX.]<br />
To   separator and prefix : [.][INBOX.]<br />
++++ Calculating sizes ++++<br />
From Folder [INBOX]                             Size:      1623 Messages:     2<br />
Total size: 1623<br />
Total messages: 2<br />
Time : 12 s<br />
++++ Calculating sizes ++++<br />
To   Folder [INBOX]                             Size:      1619 Messages:     2<br />
Total size: 1619<br />
Total messages: 2<br />
Time : 0 s<br />
++++ Listing folders ++++<br />
From folders list : [INBOX]<br />
To   folders list : [INBOX]<br />
++++ Looping on each folder ++++<br />
From Folder [INBOX]<br />
To   Folder [INBOX]<br />
++++ From [INBOX] Parse 1 ++++<br />
++++ To   [INBOX] Parse 1 ++++<br />
++++ Verifying [INBOX] -&gt; [INBOX] ++++<br />
+ NO msg #5 [imWT88lfpdVUriyDdDcAOA:905] in INBOX<br />
+ Copying msg #5:905 to folder INBOX<br />
flags from : [\Seen][]<br />
Copied msg id [5] to folder INBOX msg id [11]<br />
+ NO msg #6 [lOzMkdoLOuFH7qheMK4NkQ:718] in INBOX<br />
+ Copying msg #6:718 to folder INBOX<br />
flags from : [\Seen][]<br />
Copied msg id [6] to folder INBOX msg id [12]<br />
Time : 1 s<br />
++++ Statistics ++++<br />
Time                   : 13 sec<br />
Messages transferred   : 2<br />
Messages skipped       : 0<br />
Total bytes transferred: 1623<br />
Total bytes skipped    : 0<br />
Total bytes error      : 0<br />
Detected 0 errors</strong></p></blockquote>
<p>At this point in the game, there&#8217;s no difference between imapcopy and imapsync. They both appear to fulfill the same role; copy the messages from one inbox to another. However, imapsync is much more capable than it appears on a first glimpse. As we&#8217;ll see in this next run, imapsync has more capabilities packed in.</p>
<blockquote><p><strong>++++ Statistics ++++<br />
Time                   : 12 sec<br />
&lt;b&gt;Messages transferred   : 0 &lt;/b&gt;<br />
Messages skipped       : 2<br />
Total bytes transferred: 0<br />
Total bytes skipped    : 1623<br />
Total bytes error      : 0</strong></p>
<p><strong>Detected 0 errors</strong></p></blockquote>
<p>In the above snippet, we only display the compte rendu of the second run. As you can see, no messages were transfered over to the destination inbox. Impasync is an incremental tool. Big deal!</p>
<p>At this point, all that is needed is a source and destination host, a list of users and respective passwords. But our goal is not to batch the whole operation. The reason being we want to avoid long running jobs with higher latency that could affect end-user experience. Therefore we have to come up with a per-user at-logon solution.</p>
<p>It is common during migrations to ask users to visit a &#8220;migration&#8221; link in order to get the conversion or mailbox sync started. This is an OK approach and it works fine with Imapsync. The webmail page in question launches Imapsync on the server-side code of the page; quite simple. There&#8217;s an alternative, which is to hijack the IMAP software running on the legacy server. The latter method involves as creating a wrapper around the binary so that not only authentication is performed (as usual) but also an Imapsync session is started in the foreground or background. We won&#8217;t go over this here for now as we&#8217;ll stick with the migration link approach.</p>
<p>In the next installment, we&#8217;ll go over Web migration and then follow it up with database migration.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.unixy.net/2008/10/web-application-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.175 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-01-16 12:35:20 -->

