Server migration HOWTO

Discuss installation of Scalix software

Moderators: ScalixSupport, admin

humpty
Posts: 68
Joined: Thu Jan 04, 2007 8:18 am

Server migration HOWTO

Postby humpty » Mon Aug 20, 2007 5:24 am

Is there a document somewhere detailing how to migrate between servers?

I have 11.0.4 on RH ES3 and want to move to 11.1 on CentOS 5. I tried a clean install of 11.1 to test and it all worked fine. Then I removed it again.

To do the migration I copied /var/opt/scalix/xx to the new server and installed 11.1 referring to that mailstore (same hostname) assuming that the install process would find an 11.0.4 mailstore and upgrade it. However when this finished none of the Scalix processes or Apache were started. Apache in particular because there was nothing in /var/opt/scalix/xx/global.

What should I really be doing to do this migration? I don't want to mess around too much as the mailsotre takes over 3 hours to copy!

thanks

Valerion
Scalix Star
Scalix Star
Posts: 2730
Joined: Thu Feb 26, 2004 7:40 am
Location: Johannesburg, South Africa
Contact:

Postby Valerion » Mon Aug 20, 2007 8:27 am

If the hostname stayed the same, you can copy /opt/scalix/global (please note, not /var/opt/scalix) from the old server to the new one without a problem. It just contains the instance name, hostname and mailstore location

Mouseclone
Posts: 209
Joined: Thu Nov 02, 2006 12:02 pm

Postby Mouseclone » Mon Aug 20, 2007 9:01 am

I have a few articles in my blog about some of this. If you have difrent host names I would suggest an import instead of a move. I did a move and I will never do it again on a different host. ie /var/opt/scalix/xx and /var/opt/scalix/yy

you will need first and last name, passwords, and account name. Follow some of what Iwrote up here.

you will then want to do an IMAPsync between the 2 servers. To preserve the time stamps for Outlook if you have users that connect with Outlook via IMAP..

Things can get messy quickly and give you big problems if you do not watch it.

humpty
Posts: 68
Joined: Thu Jan 04, 2007 8:18 am

Postby humpty » Mon Aug 20, 2007 9:54 am

Oh noes! My mailstore is over 30Gb. When I went to Scalix I used IMAPsync to copy everything over. Best part of a day to set up the users/mailing lists/viretual addrtesses etc, then over a week to sync each of the folders. If that's the only way I can switch servers then I'm sorry, but Scalix will have to be junked.

Can I really not just copy /var/opt/scalix/xx and install 11.0.4 over the top of the existing mailstore? I can always upgrade to 11.1 later (can't I?)?

Mouseclone
Posts: 209
Joined: Thu Nov 02, 2006 12:02 pm

Postby Mouseclone » Mon Aug 20, 2007 10:01 am

well i did just copy /var/opt/scalix/xx to my new server. I had a few issues.

on the first server it was /var/opt/scalix/sx and the new server was /var/opt/scalix/bw. I has to redo all of the Indexes for the server. I also think that after the move I did a reconfigure so that sxadmin would work for SAC.

Moving the dir from one server to another that doesn't have the save /var/opt/scalix/xx dir is about like changing the FQDN on the server. I can get messy, and as it says in the Wiki, what you just did was a bad idea.

I am running on a production server that was moved. It is possible to do so. It just took some heartache getting it all settled down.

humpty
Posts: 68
Joined: Thu Jan 04, 2007 8:18 am

Postby humpty » Mon Aug 20, 2007 10:08 am

I am keeping the hostname. This is a replacement server to upgrade our ageing hardware and O/S. I really cannot deal with spending over a week copying down all the user details, re-entering them and syncing all the mailboxes over every six months or so.

Surely Scalix should install over the top of an existing mailstore? If not then do I have to set up a new instance and imapsync the mailstore over every time I need to reinstall Scalix? Shouldn't the installer see the mailstore and think 'ah-ha I'm doing a reinstall/upgrade so install the software and keep the old settings'? This seems a major flaw in the Scalix installer.[/b]

Mouseclone
Posts: 209
Joined: Thu Nov 02, 2006 12:02 pm

Postby Mouseclone » Mon Aug 20, 2007 10:16 am

the steps that I used:

Install on new server.
Copy mail store.
Reconfigure server.
Re index mailstore for all users.
server happy.

You will more than likely need to:

copy mailstore to the new server. I would do something like /scalix/oldmailstore
change the FQDN of the server first.
install Scalix.
copy /scalix/oldmailstore -> /var/opt/scalix/xx
reboot server. or test. that should work if keeping the same xx or FQDN name. Would test first.

interways2
Posts: 45
Joined: Wed Jan 10, 2007 11:59 am

Postby interways2 » Mon Aug 20, 2007 11:09 am

This applies just for reinstalling on another server, not upgrading from previous versions!!!

We had big problems doing it the suggested way (copy var/opt/scalix, then install).

The solution for us was:

1.) install Scalix on new box with same IP/hostname as on old box

2.) copy /var/opt/scalix to new box (over the new /var/opt/scalix)

3.) uninstall Scalix on new box

4.) reinstall Scalix on new box

Then it suddenly worked.

Good luck, these things seem to be a little flawed and definitely need improvement from Scalix!!!
Last edited by interways2 on Tue Aug 21, 2007 6:52 am, edited 1 time in total.

humpty
Posts: 68
Joined: Thu Jan 04, 2007 8:18 am

Postby humpty » Mon Aug 20, 2007 11:52 am

Aargh!

I tried the suggestion from interways 'install, copy over /var/opt/scalix, uninstall, ....' and the bl**dy thing deleted the mailstore I'd spent all day copying. bah!

I suspect I'm going to have to use IMAPsync in which case it's back to cyrus for me.

Mouseclone
Posts: 209
Joined: Thu Nov 02, 2006 12:02 pm

Postby Mouseclone » Mon Aug 20, 2007 12:40 pm

don't copy the mail store first unless you do it to a different location.

ianare
Posts: 61
Joined: Tue Sep 19, 2006 1:13 pm

Postby ianare » Mon Aug 20, 2007 12:42 pm

this is an used-to-be-internal document I wrote documenting our changeover from 10 to 11.1. I changed my host to FQN. Hope it helps.

Code: Select all

SCALIX 11.1 ON CENTOS 5

== setup OS ==

install OS with: httpd (apache2), modSSH, posgreSQL, sendmail-cf, clamAV, stunnel

install other scalix dependencies (see scalix documentation)


make stunnel certificate file:

$ cd /etc/pki/tls/certs/
$ make stunnel.pem
$ chmod 400 stunnel.pem

set up /etc/stunnel/stunnel.conf as follows:

# Path to certificate file.
#
cert = /etc/pki/tls/certs/stunnel.pem

# Are we client or server?
# Set to "no" for Server mode.
#
client = no

# Services for secure tunnelling:
#
[pop3s]
accept  = 995
connect = 110

[imaps]
accept  = 993
connect = 143

[ssmtp]
accept  = 465
connect = 25



install crypto-utils (missing in centOS install for some reason)
You can use crypto-utils-2.3 from fedora6

now make the SSL certificate (valid 2 years):
$ genkey --days 730 FQDN


edit /etc/httpd/conf.d/ssl.conf

for 'SSLCertificateFile' set /etc/pki/tls/certs/FQDN.cert
for 'SSLCertificateKeyFile' set /etc/pki/tls/private/FQDN.key

$ /etc/init.d/httpd restart



== install Scalix ==

= scalix 10.x to 11.x =
copy entire scalix directory:
$ rsync -ravz oldserver:/var/opt/scalix newserver:/var/opt

= scalix 11.x to 11.x =
copy ONLY messages:
$ rsync -ravz oldserver:/var/opt/scalix/**/s/ newserver:/var/opt/scalix/**/s

where ** is the 2 letter name of the directory (may change)



hostname must be exactly the same as old server, ip can be different

Rename the name of the release, in /etc/redhat-release

replace original with:
Red Hat Enterprise Linux Server release 5 (Tikanga)

start the scalix-installer...

If user ID for the 'scalix' user are different, start the installer, and have the user admin panel open. Hit refresh to see when the
scalix user is created. AS SSON as the user apears in the list, run this:
$ find -user $OLD_USERID -exec chown -R scalix.scalix {} \;

(would be better to know the user ID of the to-be-created scalix user and run the command before!)

If the installer crashes, run above find command again, then re-run installer to set the configuration.

might need to run:
$ ompatchom
if there were problems.

After the scalix install you should revert redhat-release to original

You should be able to run:
$ /etc/init.d/scalix start

check running scalix processes
$ omstat -s
$ omstat -a


== Post Install ==

= SSH fix =
If modSSH was instaled before scalix, it should be picked up and tomcat will run in SSH mode, however there might be 404 error
accessing FQDN/webmail.

in:
/etc/opt/scalix-tomcat/connector/ajp/instance-mail.conf
/etc/opt/scalix-tomcat/connector/jk/instance-mail.conf

find a line like <VirtualHost FQDN:443>, change to:
<VirtualHost *:443>

$ /etc/init.d/httpd restart
$ /etc/init.d/scalix-tomcat restart


= Startup Sequence =
scalix
postgres
tomcat
ldapmapper
sendmail


= Stop Open Relay =

/var/opt/scalix/ml/s/sys/smtpd.cfg

SMTPFILTER=TRUE
#RELAY accept ALL
RELAY accept 127.0.0.1
#RELAY accept .domain.com
RELAY Log_Reject ALL


= Force HTTPS =
/etc/opt/scalix-tomcat/connector/jk/instance-mail.conf
/etc/opt/scalix-tomcat/connector/ajp/instance-mail.conf

after:
<VirtualHost FQDN:80>
  Include /etc/opt/scalix-tomcat/connector/jk/app-mail.*.conf
 
add:

    <LocationMatch "^/sac/*">
        RewriteEngine on
        RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    </LocationMatch>
    <LocationMatch "^/webmail/*">
        RewriteEngine on
        RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    </LocationMatch>

humpty
Posts: 68
Joined: Thu Jan 04, 2007 8:18 am

SOLVED - definitive answer

Postby humpty » Tue Aug 21, 2007 6:03 am

Hah - got it! New day, huge mug of strong coffee and bingo!

1). start with a clean install of 11.1, make sure it's working.
2). stop scalix and scalix-tomcat
3). rename the mailstore from /var/opt/scalix/xx
4). replace the mailstore with the one from the old 11.0.4 server
5). run ompatchom to upgrade the mailstore
6). restart scalix and scalix-tomcat

.....and it all appears to work!

Now can someone alter the installer script so that does ompatchom instead of ommakeom if it finds a mailstore already exists?

Mouseclone
Posts: 209
Joined: Thu Nov 02, 2006 12:02 pm

Postby Mouseclone » Wed Aug 22, 2007 11:16 am

Glad you got it working humpty. Glad there is a better way than the way that i did it. I will know next time for a future migration.

Has humpty said. Would be nice the have that check even if scalix is not installed on the server yet. I would assume that Scalix does a check to see if it is there and if not over writes the dirs. If scalix is there it will upgrade.

I agree adding if scalix is not installed check to see if 1 or more /var/opt/scalix/xx exist and preform integrity checks and upgrade/updates.

Then again I have never looked at Scalix code and that could be asking a lot depending on the way it all works.

kanderson

Postby kanderson » Wed Aug 22, 2007 2:08 pm

You should be able to install over an existing mailstore. I've certainly done it before.

The reason you install Scalix, and then uninstall it, before you copy the data over, is that you need to create the UID and Group. That can be done without an install, but it's generally easier to just do the install.

As long as the hostname and the IP stay the same, there should be no problem with just copying the data over, and starting it up.

The only exception to this is with Postgres. If the architecture of your processor changes (32-64 bit, for example, Postgres can get blown up. That's really not the end of the world, as the data can simply be rebuilt, but it is a gotcha you may want to be aware of.

If it happens, just delete postgres, remove the cache data, and reinstall postgres. Remember it'll hammer your server for a while regenerating the data.

Kev.


Return to “Installation”



Who is online

Users browsing this forum: No registered users and 0 guests

cron