Discussion Locked

Merging 2 Linux Mail Servers

0 helpful
21 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there a safe and assured way to avoid conflict with password files (as well as group ID's, etc) when merging two linux mail servers into one?

21 replies

by hugevlad

Quick answer - no.
If you created users manualy in both servers, each username may correspond with different IDs (and GIDs).
How many users do you have ? May be, good solution is manualy merge passwd and group files, make corrections of UID and GID if need. There is some troubles if you plan move mailbox files content too. Then, you will need issue chown command many times :) or do something with 'for' expression.
With best regards,
Vlad
mailto:hugevlad@yahoo.com

by jpereira

I'd write a shell script to take the password file from server1, extract the user names and any other info you want to carry across (not passwords, UIDs and GUIDs) and run useradd (or is it adduser?) on server2 to add the logins to the server2's password file. The script would first check server2's password file for conflicts (e.g. root would already exist) and log an error somewhere. As each user is created your script should generate a random password to either keep yourself to tell the user or automatically mail to the user on server1.

by mutated

Yes and No
You could write a shell script to take care of most issues (move aliases passwd username etc..) what I would do is manually resolve the other issues such as duplicate user/group names (if it is two seperate users one of them is going to need a new username, if 1 user has accounts on both systems but diffrent passwords you are going to have to make them pick one etc...) after that I would write a simple shell script with awk & sed to move all the users on one machine over to another assigning them all a higher UID and GID then on the current users on the other machine, move your aliases over to virtualusertable from aliases so that you can have duplicate alises in diffrent domains, then when everything is moved modify your sendmail.cf and change your DNS...

by sukrith

Yes!! You can have as many domains which can use as mail server in a single linux box.What all you have to do is just impliment virtual domain concept and give each domain a unique IP address and different password files with that domain name to make it easier to identify.User on that domain can only recieve mails for that perticular domain.
Use netconf to configure virtual domain and you mention the password file in vhome directory as mention in help.
I have implimented this for our use.
Ifyou want in detail please mail me at
raghav@cityonlines.com
No need of shell scripts or perl scripts.

by bruce timberlake

you would have to write your own script to parse the lines of /etc/passwd on each machine, and come up with a way to merge them together without duplicating UID/GID/etc. To be safe, make copies of each machine's file before merging, in case something blows up.

by rwscc

You would think that the con artists that post "If you solve a question you should close it" would be disqualified from recieving points. If anyone else feels these freeloaders should be disqualified please give techrepublic the feedback on this matter. They are stealing points from people who try to give valid answers.

This discussion is closed to new replies.