Page 1 of 1

Copy message store or install scalix first?

Posted: Sun May 03, 2009 11:01 am
by audiotron2002
Hi. I am upgrading our server this weekend. I have three questions.

1. do I rsync -avH /var/opt/scalix 10.0.0.2:/var/opt then run scalix installer? Or do I run the installer first then copy the message store? Is it really this easy?

2. does it matter that I am switching from centos 4 to centos 5?

3. Can I chance the IP address once its copied using the info in the wiki?
Thansk

Re: Copy message store or install scalix first?

Posted: Mon May 04, 2009 12:53 am
by Valerion
So a clean install first, with an empty mailstore. Backup this mailstore, then copy the old machine's data.

Re: Copy message store or install scalix first?

Posted: Mon May 04, 2009 9:20 am
by les
Valerion wrote:So a clean install first, with an empty mailstore. Backup this mailstore, then copy the old machine's data.


Yes, but not enough.

postgres changed from version 7 to version 8 in centos 5. There is no upgrade tool to convert your old postgres db into new version 8. if you just sync the data files postgres will fail to start. So, the next best thing, considering postgres is full of indexing data, is to backup your virgin "new" mailstore, rsync across the old data, move the old postgres directory to ".old" and copy the virgin postgres directory in place. Then your indexes will rebuild from scratch.

There are other prerequisites like whether your changing version numbers between platforms. If you're running an older version i think it is best to install the same version on the new server, then if you want to upgrade to the latest do it after your got the current version working. Also your hostname should be identical, and if you have to change your IP address then the wiki instructions detail that (mind you, less client side changes if your new server takes over the old ip address).

This process has been discussed a lot on the forums.....

See here....viewtopic.php?f=4&t=12710&p=58645&hilit=postgres+virgin#p58645
and
viewtopic.php?f=5&t=12608

Re: Copy message store or install scalix first?

Posted: Tue May 05, 2009 4:48 pm
by audiotron2002
So I installed Scalix then rsynced the mailstore directory and ran omcheck ran ompatchom. Fixed IP address (per WIKI instructions).

Everything worked fine. I never had the postgres you reference so I am not sure your comment about it not working on Centos 5 is true. Maybe there was a different issue?

i havent pulled the trigger on the new server yet. I am just testing but each time i re-rsync, i have no problem.

I do, however, have the permission problem and i run the omcheck -d and it seems to fix it.

Re: Copy message store or install scalix first?

Posted: Tue May 05, 2009 5:48 pm
by les
audiotron2002 wrote:So I installed Scalix then rsynced the mailstore directory and ran omcheck ran ompatchom. Fixed IP address (per WIKI instructions).

Everything worked fine. I never had the postgres you reference so I am not sure your comment about it not working on Centos 5 is true. Maybe there was a different issue?

i havent pulled the trigger on the new server yet. I am just testing but each time i re-rsync, i have no problem.

I do, however, have the permission problem and i run the omcheck -d and it seems to fix it.


Maybe things have changed regarding the postgres. I had it ages ago (in the early 11.0 releases if memory serves...) and i've always just been happy to start afresh and let postgres reindex from scratch.

But as long as "service scalix-postgres status" shows it running and there's no errors in /var/opt/scalix/??/postgres/pgstartup.log then you should be right.

Glad to see you got it running properly.

Re: Copy message store or install scalix first?

Posted: Tue May 05, 2009 6:04 pm
by audiotron2002
So.. guess what? You are correct! I only saw the error once i looked in the log. So what does scalix use postgres for since it seems everything is working as it is. I read somewhere caldev and mobile need it (both of which i dont use and that is why i didnt see the error). If scalix will work fine w/o it then I may just forget about it.

There has to be an easier way then copying the "virgin" postgres directory form the new install? Can you simply delete the database and then rerun the scalix-postgres script? what about uninstalling the scalix-db component and then reinstalling it?

Im glad you mentioned that because I was ready to make the new server live!

Scalix should build into their install program the "bare metal" restore concept.

Re: Copy message store or install scalix first?

Posted: Tue May 05, 2009 6:21 pm
by les
audiotron2002 wrote:So.. guess what? You are correct! I only saw the error once i looked in the log. So what does scalix use postgres for since it seems everything is working as it is. I read somewhere caldev and mobile need it (both of which i dont use and that is why i didnt see the error). If scalix will work fine w/o it then I may just forget about it.



You will want it, postgres is used to store all the indexes for searching, especially in the webclient. So if you ever want to be able to search for mails you should fix it ;)

audiotron2002 wrote:There has to be an easier way then copying the "virgin" postgres directory form the new install? Can you simply delete the database and then rerun the scalix-postgres script? what about uninstalling the scalix-db component and then reinstalling it?


No easier way that i know of, and to me, that is the easiest. postgres is all contained in /var/opt/scalix/??/postgres so whats not easy about....

1. install new scalix on new server.
2. stop scalix.
3. mv /var/opt/scalix/?? /var/opt/scalix/??.old
4. rsync...blah blah...
5. cd /var/opt/scalix/??
6. mv postgres postgres.orig
7. rsync -av /var/opt/scalix/??.old/postrges .
8. ompatchom, omcheck etc.
9. start scalix, postgres is "virgin" and started from scratch.

i wouldn't muck around with trying to remove parts of scalix using the installer in this case. Its far easier to do the process above. I've done it multiple times without problem.

audiotron2002 wrote:Im glad you mentioned that because I was ready to make the new server live!

Scalix should build into their install program the "bare metal" restore concept.


I don't think its something that can be done by Scalix.

When i first had this problem after upgrading to CentOS 5 i tried to find a postgres tool to convert a version 7 database to version 8. My thinking....given the error in the logs surely there is an upgrade tool/script...pg-upgrade or something but alas there was nothing out there, no hints or tips. Now i'm no postgres expert at all but getting postgres under scalix to "start from scratch" using postgres 8 on CentOS 5 using the above method became the way to do things for me and it worked.

Maybe a mention of this in the scalix release notes as a known problem is a good idea.

Re: Copy message store or install scalix first?

Posted: Wed May 06, 2009 1:51 pm
by jangi
Maybe les can comment further, but I used a different procedure to migrate to a new server (different os, 64-bit instead of 32-bit, etc). I wanted the "cleanest" possible install. It's been awhile so I may have this a little wrong.

1- Create the scalix directory on the new server (/var/opt/scalix/??)
2- rsync over only the s/ directory
3- copy /etc/opt/scalix/instance.cfg to the new server
4- run the scalix installer, it should detect the existing mailstore, install/create the rest of the directory structure.

You should run omcheck/ompatchom/etc. Also, any customizations to things like swa.properties will have to be remade (or copied over). Specifically check Osmtpd.cfg.

Re: Copy message store or install scalix first?

Posted: Wed May 06, 2009 6:17 pm
by les
jangi wrote:Maybe les can comment further, but I used a different procedure to migrate to a new server (different os, 64-bit instead of 32-bit, etc). I wanted the "cleanest" possible install. It's been awhile so I may have this a little wrong.

1- Create the scalix directory on the new server (/var/opt/scalix/??)
2- rsync over only the s/ directory
3- copy /etc/opt/scalix/instance.cfg to the new server
4- run the scalix installer, it should detect the existing mailstore, install/create the rest of the directory structure.

You should run omcheck/ompatchom/etc. Also, any customizations to things like swa.properties will have to be remade (or copied over). Specifically check Osmtpd.cfg.


Well, that sounds feasible. Basically its as if you are doing a fresh install just migrating the message store only. By only rsyncing the s directory your avoiding the postgres, sis, tomcat and other directories. Thus you would never see the problem of postgres db not starting if it went from version 7 to 8. So your postgres would still be rebuilt from scratch in version 8.
The only downside, although its not really, is that you manually have to go through and redo all the "tweaks" you made like scalix plugins, swa.properties, Osmtpd.cfg, general.cfg etc etc. But if you know what your doing then its just a process to go through.

For me i prefer, when migrating in this instance, to try and "fully migrate", i.e. whatever was setup on the old server is migrated to the new server 100%. If i rsync the entire /var/opt/scalix/?? directory then i guarantee that. Thus i haven't introduced any variables into the migration as it "should" be identical to the old....or so the theory goes ;)

Either way will work, its just a matter of knowing what you have to do to migrate successfully.

Re: Copy message store or install scalix first?

Posted: Wed May 06, 2009 10:37 pm
by audiotron2002
Just to close the loop on this thread. Here is another way to skin the cat.

after copying the complete /var/opt/scalix folder....

run installer and remove scalix-db
rerun installer and install scalix-db


I tested it and it worked. This way you dont need to move additional files around. just reinstall the db component.

I think this is the easiest way to handle the postgres issue.

Re: Copy message store or install scalix first?

Posted: Wed May 06, 2009 10:49 pm
by les
audiotron2002 wrote:Just to close the loop on this thread. Here is another way to skin the cat.

after copying the complete /var/opt/scalix folder....

run installer and remove scalix-db
rerun installer and install scalix-db


I tested it and it worked. This way you dont need to move additional files around. just reinstall the db component.

I think this is the easiest way to handle the postgres issue.


Don't you love linux......so many ways to skin a cat, and they all work!

Re: Copy message store or install scalix first?

Posted: Thu May 07, 2009 1:49 am
by Valerion
Yes, this is the one thing I forgot abo[list=]ut, as I do this without even thinking these days. And it is a big problem with Postgres for me. The official documentation states that the only way to upgrade between releases is is to dump your data, recreate the DB and re-import the data. A big shortcoming for corporate data, in my opinion.

http://www.postgresql.org/docs/8.1/interactive/install-upgrading.html