Mailing List Message #95970
From: Nicolas Hatier <>
Subject: Re: Moving from one server OS to another
Date: Thu, 04 Sep 2008 20:11:19 -0400
To: CommuniGate Pro Discussions <>
Note using FTP will force you to transfer every single file individually - a LOT of FTP commands will have to be issued, increasing a lot the transfer time especially if you use the mdir format. Transferring a tar(.gz) file is much more efficient.

The following perl script, providing it is ran on the Windows platform, will convert all mail files in-place from unix EOL to windows EOLs.
Save the script as, run <directory> and all files will be converted recursively.

$| = 1;
$directory = shift @ARGV;
$directory = '.' unless $directory;
sub conv
   my $dir = shift;
   opendir DIRHANDLE, $dir;
   foreach my $file (readdir DIRHANDLE)
      next if ($file =~ /^\./);
      next if ($file =~ /\.settings$/); #skipping settings, info, dst, CGP can handle them.
      next if ($file =~ /\.info$/);     #only mail files must be converted, others are optional.
      next if ($file =~ /\.dst$/);
      $file = "$dir/$file";
      if (-d $file)
         print "Convert: $file";
         open(INPUT, "<$file");
         my @lines = <INPUT>;
         close INPUT;
         open(OUTPUT, ">$file");
         print OUTPUT $_ foreach(@lines);
         close OUTPUT;
   closedir DIRHANDLE;

Nicolas Hatier

David Brookfield wrote:
Ahh coolio, then looks like I'll try FTP then :-)

Wayne Gamble wrote:
I've moved my CGatePro server from RH Linux to SuSE, and then from SuSE Linux to OS X by just copying the files.  However, Windows doesn't handle files like everyone else.   Windows uses a line feed and carriage return, but Unix/OS X, etc. just uses a line feed.

The only way I've ever moved files (not cgate) from Unix -> Windows or Windows -> Unix is by using FTP, but I understand there are utilities available that will also do the conversion for you.

 - Wayne

On Sep 4, 2008, at 2:52 PM, Dave Pooser wrote:

I'm led to believe that it's just a case of dropping the files over from
the server you are moving from, anyone know if this really is the case?

It's the case when moving from UNIX -> UNIX or Windows -> Windows; the
problem in your case is migrating the line endings to fit the new server
platform. I've seen people suggest that if you use FTP to transfer the
CommuniGate directory that will fix any line ending problems, but I don't
have any personal experience with that.


Nicolas Hatier
Niversoft idées logicielles

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster