Page 1 of 1

Just Move Usernames/Passwords From Old Installation

Posted: Sun Dec 07, 2008 2:23 pm
by smpoole7
We are moving to a new installation of Scalix 11.4.2 on CentOS. The old server is 11.4.1 on OpenSuse 10.2.

We *just* want to move the usernames and passwords. The /var/opt/scalix/XX directory (and subdirectories) obviously has errors in it regarding ownership and permissions. After trying to go through the directory file by file for the past few days (omcheck only finds gross errors; it's useless for this), we just want to start over. But it'd be nice not to have to reenter all users by hand, then figure out a way to inform them all that they have new temporary passwords, etc., etc.

I've done several searches here, and I know about omaddu, omshowu, and I've used omsearch -d userlist -t h -e s=* to generate a file containing bulk user info, including names and passwords (encrypted).

From searching here, it seems that the "approved" method is to transfer the entire mailstore. But as I said, our mailstore directory has errors, and we just don't have any more time to look for the granular permission/ownership errors that are still in there. Fortunately, we CAN extract the user info. That part is apparently OK.

We have approximately 400 users. Is there any way to automate this process? Or do I have to run omaddu/ommodu for each one, one at a time? If someone can just give me an overview of the commands, I'll write a shell script or something like it to handle the grunt work.

Posted: Mon Dec 08, 2008 2:56 am
by Valerion
1) omshowmn to get a list of mailnodes

2) For every mailnode:
2.1) omshowu -m <mailnode> to pull a list of all users on that mailnode
2.2) For every user:
2.2.1) omshowu -n "User Name" to get all the user info, save to a seperate file
2.2.2) omsearch -e S=Name/G=User to get extra directory information, store to a file

Then on the destination server, you use omaddmn to add the mailnodes, then for every user record on the previous server, you run a omaddu to restore the user's attributes, then you do a ommodent to restore the extra directory information.

Check the man pages for all these commands.

Posted: Mon Dec 08, 2008 8:29 am
by smpoole7
Thanks a million!

I looked at the man page for omshowu, and must have missed something.

THANKS!

Passwords?

Posted: Tue Dec 09, 2008 1:13 am
by smpoole7
The command sequence that you showed doesn't seem to move the passwords. After looking at the man pages, I'm not sure that it can be done with those commands.

The omsearch syntax that I showed in my original post used the "-t h" (hidden) option, and display the password, but it's encrypted. How to I import that encrypted password into my new server? From looking at the man page for the om*user commands, they want the password in plain text.

-- Stephen

Posted: Tue Dec 09, 2008 3:28 am
by Valerion
You can always assign a default password (first name?) and pre-expire it so the user's forced to change it.

Not sure if it will work, but you can try to change the password directly in the USERLIST directory using ommodent. However, I wouldn't recommend it, as you may break things that way.

Posted: Tue Dec 09, 2008 1:06 pm
by schmoe90
Just push the ul-pwd from the old userlist into the new userlist in ommodent, it should work fine.

Thanks

Posted: Wed Dec 10, 2008 1:15 am
by smpoole7
I'll try using ommodent. The good news is, I'm doing this on a new CentOS server, and if I kill anything, I'll just reload and start over. :D

Once I get the second server running, we can notify everyone via email (using the current server) to backup everything before a certain date. Then we'll just put the new server online with a completely clean mailstore.

Thanks again. We'll gitterdone. :)

Posted: Thu Dec 11, 2008 1:42 am
by kanderson
Just as a heads up. If the problem is that you're seeing incorrect permissions, then copy it over and fix the permissions.

Use the following commands:

chmod -R scalix:scalix /var/opt/scalix/??/s
omsheck -d -s > /tmp/perms.txt && bash /tmp/perms.txt

That'll fix most of it up. There MIGHT be some minor issues with postgres, and stuff, but if that's the case, just uninstall the postgres stuff, and reinstall it. That's just as easy.

Kev.

Thanks

Posted: Thu Dec 11, 2008 3:12 am
by smpoole7
Kev,

I've already tried both chown and chmod, and I did two complete reinstalls. That increased the length of time before each crash, but I'm still getting them at random. The real issue may be the lock (.lck) files. To be honest, I'm not sure how they work (are they incremented and decremented)? They appear to exist whether the users are logged in or not.

The basic issue is that our backup was rsync'd while the server was still running. (A mistake made by someone else.) When we lost our mailstore, we had no choice but to use that backup, even though (judging from other posts here), that does result in corruption. I am NOT blaming Scalix for this.

The logs haven't been a whole lot of help, either. Scalix will just stop running; the fatal log will have "ERROR - Administration( Scalix Admin C), SYS 2 - no such file or directory" -- but no filename will be listed.

(I touched on that in this thread: .http://www.scalix.com/forums/viewtopic.php?t=12124&highlight=)

At least once a day, I get a message from someone who can't log in, either with a mail client or to webmail. The error is the same: it'll keep saying that the password or username is incorrect. We can *sometimes* fix this by resetting the password. More often than not, we have to delete, and the recreate, the user anyway.

So ... given that our users are terrible at deleting old messages, there are administrative reasons why I'd like to start over "clean." Being able to move the usernames and passwords would make that a lot easier on us