Hello, I am getting a new computer and am going to need to move the files from the old to the new. What is the best way to do this? Should I install CentOS from scratch on the new computer then move the directories I need? How do I maintain permissions if this is the best way? TIA Eddie
-----Original Message----- From: Thomas E Dukes <edukes at alltel.net> To: CentOS <centos at centos.org> Sent: Sun, 5 Mar 2006 09:34:37 -0500 Subject: [CentOS] Moving files to new server Hello, I am getting a new computer and am going to need to move the files from the old to the new. What is the best way to do this? Should I install CentOS from scratch on the new computer then move the directories I need? How do I maintain permissions if this is the best way? ------------------------------------------------------------------------- ----------------- If you install centos on the new comp, create users on the new comp with the same user name and user ID as on the old one(you can refer to /etc/passwd for UID). Plug the HDD of the new comp to the old linux machine Create a folder, say "NewHDD" in /mnt Mount the new HDD partition (where you want your data to be copied to) to /mnt/NewHDD Use the cp command as root with --preserve[=ATTR_LIST] option to copy the files from their old(old HDD) location to new location(on the new HDD). Refer to man cp for more info about cp options. Hope it help Thai ________________________________________________________________________ Check Out the new free AIM(R) Mail -- 2 GB of storage and industry-leading spam and email virus protection.
Thomas E Dukes wrote:> Hello, > > I am getting a new computer and am going to need to move the files from the > old to the new. What is the best way to do this? > > Should I install CentOS from scratch on the new computer then move the > directories I need? How do I maintain permissions if this is the best way? >If you have the luxury of having both machines online at the same time, why not just use the easy way out and use rsync? Or as someone else suggested, you could physically attach the new drive to the old computer and copy the data to to it with any number of tools (tar/dump/cp/etc....). Cheers,
I keep a file called "Migration Script" for each server. It's a list of everything I had to install to operate everything on the server. Any time I have to install or change the config on the server, I update this file as well. Every 2 years or so, when I'm getting ready to set up a new server, I review this file as I build a new system. After everything has been installed, I prepare a final "switchover plan" that contains detailed (line by line, file by file) instructions in review for switching over things like /etc/passwd & /etc/shadow, ntp.conf, sshd_conf, /etc/sysctl.conf, and so on. This keeps downtime in switchover minimal, even when I'm doing a "worst case" emergency switchover. (EG: hosting provider goes belly-up without any warning at all, which happened once) One of the steps in this whole process is that I carefully keep a list of all client data in var by directory (eg: /var/spool/mail, /var/spool/cron) and otherwise keep all other client data in /home, so that I know exactly what files to keep from OS to OS. (For example, copying over /var/lib/rpm could seriously bork things, while keeping /var/www can be crucial) I use rsync to copy over this data, either from the server-to-be-replaced or from backups as appropriate to the new server. -Ben On Sunday 05 March 2006 06:34, Thomas E Dukes wrote:> I am getting a new computer and am going to need to move the files from the > old to the new. ?What is the best way to do this? > > Should I install CentOS from scratch on the new computer then move the > directories I need? ?How do I maintain permissions if this is the best way?-- "The best way to predict the future is to invent it." - XEROX PARC slogan, circa 1978 -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
> > From: "Thomas E Dukes" <edukes at alltel.net> > Date: 2006/03/11 Sat AM 08:40:41 EST > To: "'CentOS mailing list'" <centos at centos.org> > Subject: RE: [CentOS] Moving files to new server > > > > > -----Original Message----- > > From: centos-bounces at centos.org > > [mailto:centos-bounces at centos.org] On Behalf Of Les Mikesell > > Sent: Sunday, March 05, 2006 1:01 PM > > To: CentOS mailing list > > Subject: RE: [CentOS] Moving files to new server > > > > Version-level upgrades are always a bad idea because they can > > leave old stuff around. I'd recommend taking this > > opportunity to clean things up with a fresh install and only > > copy over the contents of the home directories and any ftp or > > web sites that might be set up. Bring the new machine up > > with a different IP and name at first, then copy over things > > and configure it to match the old one, keeping a log of > > anything you have to do that isn't completely obvious. > > You can copy files with 'scp file newmachine:/path' or > > directories or files with: > > rsync -av -essh source newmachine:/path/to/target. > > Copy over /etc/passwd, /etc/shadow, /etc/group, /etc/gshadow > > and rsync the /home directory and any directories containing > > web or ftp sites. > > Hello, > > The new server is in and I am about to attempt the file transfers. I have > NEVER attempted this and want to do it right the first time. > > Reading the man pages for cp and scp it looks as if the -a switches are > different. Are they? I want/am going to transfer files/directories across > the local network. Should I work from the new machine or the old? What > files are machine dependent? In other words, what files, if any, should not > be copied because of hardware differences? > > Sorry for all the seemingly stupid questions but as I said, I have never > undertaken this before. > > TIAStill need an answer to my question. In deleting in user who's system has gone crazy that responded to my post, pls don't delete my thread. Thanks
Hello, The new server is in and I am about to attempt the file transfers. I have NEVER attempted this and want to do it right the first time. Reading the man pages for cp and scp it looks as if the -a switches are different. Are they? I want/am going to transfer files/directories across the local network. Should I work from the new machine or the old? What files are machine dependent? In other words, what files, if any, should not be copied because of hardware differences? Sorry for all the seemingly stupid questions but as I said, I have never undertaken this before. TIA