Copy message store or install scalix first?

Discuss installation of Scalix software

Moderators: ScalixSupport, admin

audiotron2002
Posts: 87
Joined: Tue Nov 22, 2005 12:41 pm

Copy message store or install scalix first?

Postby audiotron2002 » Sun May 03, 2009 11:01 am

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

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

Re: Copy message store or install scalix first?

Postby Valerion » Mon May 04, 2009 12:53 am

So a clean install first, with an empty mailstore. Backup this mailstore, then copy the old machine's data.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Copy message store or install scalix first?

Postby les » Mon May 04, 2009 9:20 am

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
Regards,

Les Stott

audiotron2002
Posts: 87
Joined: Tue Nov 22, 2005 12:41 pm

Re: Copy message store or install scalix first?

Postby audiotron2002 » Tue May 05, 2009 4:48 pm

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.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Copy message store or install scalix first?

Postby les » Tue May 05, 2009 5:48 pm

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.
Regards,

Les Stott

audiotron2002
Posts: 87
Joined: Tue Nov 22, 2005 12:41 pm

Re: Copy message store or install scalix first?

Postby audiotron2002 » Tue May 05, 2009 6:04 pm

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.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Copy message store or install scalix first?

Postby les » Tue May 05, 2009 6:21 pm

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.
Regards,

Les Stott

jangi
Posts: 193
Joined: Fri May 16, 2008 2:12 am

Re: Copy message store or install scalix first?

Postby jangi » Wed May 06, 2009 1:51 pm

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.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Copy message store or install scalix first?

Postby les » Wed May 06, 2009 6:17 pm

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.
Regards,

Les Stott

audiotron2002
Posts: 87
Joined: Tue Nov 22, 2005 12:41 pm

Re: Copy message store or install scalix first?

Postby audiotron2002 » Wed May 06, 2009 10:37 pm

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.

les
Scalix Star
Scalix Star
Posts: 819
Joined: Thu Feb 23, 2006 10:18 am
Location: Sydney, Australia

Re: Copy message store or install scalix first?

Postby les » Wed May 06, 2009 10:49 pm

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!
Regards,

Les Stott

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

Re: Copy message store or install scalix first?

Postby Valerion » Thu May 07, 2009 1:49 am

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


Return to “Installation”



Who is online

Users browsing this forum: No registered users and 6 guests

cron