Date: Thu, 15 Jan 1998 10:45:39 -0600 (CST) From: Jeff Lynch <jeff@mercury.jorsm.com> To: Jakob Alvermark <jakob@teligent.se> Cc: isp@FreeBSD.ORG Subject: Re: Moving from Linux to FreeBSD Message-ID: <Pine.BSF.3.95q.980115103528.11202E-300000@mercury.jorsm.com> In-Reply-To: <Pine.BSF.3.96.980115160554.10133A-100000@datorn.teligent.se>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, 15 Jan 1998, Jakob Alvermark wrote: > Hello. > > I'm going to upgrade our mail/www-server. It's now running a very old > version of Linux, and on the new server I want to run FreeBSD. My > question is if there is an easy way of moving the user accounts from Linux > to FreeBSD? Can I just copy the password file and home directory? Or is > there some other way to do this? Any other things I should have in mind > when doing this? > > TIA This is site dependent. I started with a linux2bsd.pl script generously supplied by someone who did this before me (see copyright in the perl script attchmt) and hacked my necessary changes in. See the appropriate comments in the attached files. I did a large set of incremental changes and found it helpful to repeat the user transporting process as many times as necessary. This approach allow a complete live switchover from Linux to FBSD (2.2.1-R at the time) with only 5 second glitch during ifconfigs for NIC address changes (after all the bugs were worked out). Keep in mind you will have to adjust search paths or create symlinks to sendmail, perl, cgi-bin stuff, etc. I use the above approach to find problems before the great cut-over. ========================================================================= Jeffrey A. Lynch, President JORSM Internet email: jeff@jorsm.com Northwest Indiana's Full-Service Provider Voice: (219)322-2180 927 Sheffield Avenue, Dyer, IN 46311 Autoresponse: info@jorsm.com http://www.jorsm.com [-- Attachment #2 --] # # refresh the saved skeleton versions of local db files # cp /etc/master.passwd.sav /etc/master.passwd cp /etc/group.sav /etc/group # # do after rcp'ing /etc/shadow, /etc/passwd, /etc/group from mercury # ./linux2bsd.pl cat new-master.passwd >> /etc/master.passwd cat new-group >> /etc/group # # remake the passwd database # cd /etc /usr/sbin/pwd_mkdb -p master.passwd [-- Attachment #3 --] #!/usr/local/bin/perl ## #**************************************************************************** # This script is copyright (C) 1996 by David G. Andersen # All rights reserved. # This information is subject to change without notice and does not # represent a commitment on the part of David G. Andersen # This software is furnished under a license and a nondisclosure agreement. # This software may be used or copied only in accordance with the terms of # this agreement. It is against Federal Law to copy this software on magnetic # tape, disk, or any other medium for any purpose other than the purchaser's # use. David G. Andersen makes no warranty of any kind, expressed or implied, # with regard to these programs or documentation. David G. Andersen # shall not be liable in any event for incidental or consequential # damages in connection with, or arising out of, the furnishing, performance, # or use of these programs. #****************************************************************************/ # # 06/15/96 slightly modified JORSM Enterprises, Inc. # recognizing above copyright but obtained via mailinglist from # public distribution. # # changes: # 1) uses a minnimal passwd file consisting of system and # special logins intended to be preserved after BSD install. # User should add their appropriate system logins to this file # and copy to /etc/master.passwd.sav (see accompanying shell # script linux2bsd.sh # # 2) only operates on uid's above 101 because of (1) and administrator's # personal account or two in bringing up the new bsd system. # $shadow = "shadow"; $passwd = "passwd"; $group = "group"; $bsdpasswd = "/etc/master.passwd"; $output = "new-master.passwd"; $outgrp = "new-group"; umask 077; open(SHADOW, $shadow) || die "Could not open shadow file\n"; while (<SHADOW>) { ($name, $enc) = split(/:/); $PASS{$name} = $enc; } close(SHADOW); open(PASSWD, $passwd) || die "Could not open passwd file\n"; open(OUT, ">$output") || die "Could not open output file\n"; while (<PASSWD>) { chop; ($name, $blah, $uid, $gid, $gecos, $homedir, $shell) = split(/:/); if ( $uid > 101 && $uid < 65534 ) { #$uid = $uid + 900; $shell = "/usr/local$shell"; printf(OUT "%s:%s:%d:%d::0:0:%s:%s:%s\n", $name, $PASS{$name}, $uid, $gid, $gecos, $homedir, $shell); } } close(PASSWD); open(GROUP, $group) || die "Could not open group file\n"; open(GOUT, ">$outgrp") || die "Could not open output file\n"; while (<GROUP>) { chop; ($name, $blah, $gid, $assoc) = split(/:/); if ($gid > 101 && $gid < 65534 ) { #$uid = $uid + 900; printf(GOUT "%s:%s:%d:%s\n", $name, $blah, $gid, $assoc); } }help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.980115103528.11202E-300000>
