LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   move /home to another computer (https://www.linuxquestions.org/questions/linux-newbie-8/move-home-to-another-computer-845807/)

Odyssey1942 11-22-2010 09:21 AM

move /home to another computer
 
I have just put together a new computer using an Intel i3-550 64 bit processor, and installed Windows (first), then Ubunutu 10.04. A separate /home partition was created. The linux partitions in this computer are formatted ext4.

Now I want to move my /home partition from my old 8.04 computer (32 bit, formatted ext3) which also has a separate /home partition.

Both are connected to a lan, but so far I have not been able to connect from one to the other.

I have done lots of googling on this and am astonished at the apparent complexity involved. There seem to be issues involving whether or not files in the /home partition in the old computer is in use at the time of copy or creating a tarball, user permissions, and I don't know what all else.

Assuming that neither the ext3 on the old and ext4 on the new, nor the 32 bit on the old and the 64 bit on the new are not issues, how do I go about moving the /home from the old to the new? If possible, I would like to use a GUI rather than the command line, but if it is necessary to use the command line, please specify where one needs to be located in the file hierarchy in order to give the designated commands. I am not very knowledgeable about using the terminal.

Also, I am a noob (probably apparent) so step-by-step instructions will be very helpful.

Thanks in advance.

i92guboj 11-22-2010 09:30 AM

Quote:

Originally Posted by Odyssey1942 (Post 4167109)
I have just put together a new computer using an Intel i3-550 64 bit processor, and installed Windows (first), then Ubunutu 10.04. A separate /home partition was created. The linux partitions in this computer are formatted ext4.

Now I want to move my /home partition from my old 8.04 computer (32 bit, formatted ext3) which also has a separate /home partition.

I need to ask a few question before I can give you a definite response, because there's a number of ways to interpret what you said, and also a number of ways to implement a solution.

So, just to clear the issue: do you want to
  • just move files from one computer to another at any given time?
  • create some kind of "shared folder" so users from two computers have a place to deploy and share stuff?
  • truly store the /home partition in the remote computer?

Quote:

Both are connected to a lan, but so far I have not been able to connect from one to the other.
Well, regardless of the answer above, this is the first thing you need to sort out. For this you first need to make sure that the computers have a working network interface, the connection is ok, and that computers in your lan can ping each other, preferably via IP AND via host name.

Quote:

I have done lots of googling on this and am astonished at the apparent complexity involved. There seem to be issues involving whether or not files in the /home partition in the old computer is in use at the time of copy or creating a tarball, user permissions, and I don't know what all else.
This depends on the "how".

Quote:

Assuming that neither the ext3 on the old and ext4 on the new, nor the 32 bit on the old and the 64 bit on the new are not issues, how do I go about moving the /home from the old to the new? If possible, I would like to use a GUI rather than the command line, but if it is necessary to use the command line, please specify where one needs to be located in the file hierarchy in order to give the designated commands. I am not very knowledgeable about using the terminal.

Also, I am a noob (probably apparent) so step-by-step instructions will be very helpful.

Thanks in advance.
Bitness and fs are a non-issue, generally speaking, since you will be using the remote fs via cifs, nfs or anything else, remotely. But we need to know more details.

Odyssey1942 11-22-2010 01:26 PM

Thanks for yours.

Quote:

So, just to clear the issue: do you want to
just move files from one computer to another at any given time?
create some kind of "shared folder" so users from two computers have a place to deploy and share stuff?
truly store the /home partition in the remote computer?
This will be a permanent move of /home. In past, the 8.04 computer has been my main workstation, but will be replaced by the new computer.


Quote:

...this is the first thing you need to sort out. For this you first need to make sure that the computers have a working network interface, the connection is ok, and that computers in your lan can ping each other, preferably via IP AND via host name.
They can ping each other by IP #. Not sure how to find computer name of the older computer?

TobiSGD 11-22-2010 01:48 PM

Quote:

Originally Posted by Odyssey1942 (Post 4167322)
Not sure how to find computer name of the older computer?

Code:

cat /etc/hostname
on the older computer.

i92guboj 11-22-2010 04:20 PM

Quote:

Originally Posted by Odyssey1942 (Post 4167322)
This will be a permanent move of /home. In past, the 8.04 computer has been my main workstation, but will be replaced by the new computer.

So all you need is a way to transfer the files from the old system to the new system, then the old one will be discarded. Is that correct?

If so, then you could proceed in a number of ways. What I'd do would be to launch sshd in your old box. Then, from the new box you can do something like:

Code:

scp -r root@a.b.c.d:/home/<whatever>/* $HOME/
Where "a.b.c.d" is the IP of the old computer (usually 192.168.something.something) and <whatever> is your home directory in the new machine. Ssh should ask for the password unless you have set up key pair authentication.

You could also use rsync, or nfs. I am just more comfortable with ssh.

If this is not what you want, please, give more details.

Odyssey1942 11-22-2010 04:28 PM

New computer successfully pings old computer by name.

New computer successfully pings itself by name.

Old computer not successful in pinging new computer by name. Gives message:

Quote:

ping: unknown host Intel-i3-550
Old computer not successful in pinging itself by name. (same message with it's own name)

i92guboj 11-22-2010 04:32 PM

You can still operate using IP's, assuming that the network is correctly configured. This could be a firewall issue as well, or more probably a misconfigured /etc/hosts file.

at2marty 11-22-2010 04:37 PM

Quote:

Originally Posted by Odyssey1942 (Post 4167472)
New computer successfully pings old computer by name.

New computer successfully pings itself by name.

Old computer not successful in pinging new computer by name. Gives message:



Old computer not successful in pinging itself by name. (same message with it's own name)

You actually have a couple of issues that need to be sorted out, the first one being your networking issue. It sounds like you have no entries in you hosts file (/etc/hosts) on your old computer.

What distro are you using? Although doing things on the command line may seem a bit tedious, it also in many ways is easier and you learn how your computer operates.

Odyssey1942 11-22-2010 09:02 PM

Ubuntu 9.04 on the old computer, and 10.04 on the new.

Dark_Helmet 11-22-2010 09:49 PM

If I might make a suggestion...

The concern of not having files open generally isn't a concern for a regular user--you know when you have files open and are modifying them. That said, I'll give you some instructions that avoid logging into your account, making sure no files are open/changing.

I avoid the networking thing because it sounds to me like the only reason for the network is to copy the files. If that's the case, it's the tail wagging the dog. Once the data is copied, then you can mess with the networking if and when you want to.

I assume you installed 10.04 with a boot CD or you have a live CD Ubuntu CD at your disposal.

1. Boot the old computer with the Ubuntu boot CD

2. Do NOT install, but select the "try Ubuntu" option

3. After Ubuntu boots to the desktop, open a file manager window

4. You should see entries on the left pane representing the partitions of your old hard drive

5. Left click on each one until you find the partition that stores your old /home directory

6. Once you locate your home directory, right-click the directory with your username

7. In the pop-up menu, select "Compress"

8. You'll have a new window giving you some options. Pick whatever suits your needs:
a) .tar.gz file is "standard"
b) .tar.bz2 generally gives a little better compression in my experience
c) .rar can be used to split the archive (if your home directory is massive) into manageable chunks (say 650 MB, 4.7 GB, or the size of a USB thumbdrive/external drive)

9. Choose the compression you want and where to save it. Save the archive in any directory of your old system's partitions EXCEPT for anywhere in your home directory (to avoid a archiving the archive). It should go without saying that you DO NOT want to save the archive in any of the in-memory live-CD filesystem directories.

10. Once the archive is complete, you can transfer it by burning it onto CD(s), DVD(s), USB drives, etc. and walking them over to the new machine. Do this step by any method you're comfortable with--using the live CD or booting into the old system's normal desktop.

11. On the new computer, extract the archive into a temporary location--DO NOT just dump the archive on top of your existing home directory.

12. Either leave the files there, or start pulling the individual files out and merge them into your new home directory.

13. Be careful with any dot files (e.g. .gconf, .mozilla, .ssh, etc.). DO NOT bulk copy them into your home directory. That could cause problems from minor warning messages to login failures. I would suggest you generally leave the dot files alone unless you are very, very familiar with them and know what you're doing.

Odyssey1942 11-23-2010 07:31 AM

i92guboj, I somehow missed yours yesterday (probably when I was typing up a reply).

Sounds simple enough for me to pull it off, but just to make sure I understand this:

on the old computer, go into terminal and type "sshd" (maybe sudo "ssd"?) (which I believe will cause the old computer to start listening for commands over the lan) (BTW, does this also cause the old computer to start listening for commands from over the internet, and if so, should I go offline from the I/N before issuing sshd?)

Then from the new computer, I will go into terminal and issue the command:

scp -r root@192.168.0.108:/home/Intel-i3-550/* $HOME/
(where 192.168.0.108 is the ip # of the new computer, and Intel-i3-550 is the name of the new computer)

or, should it be:

scp -r root@192.168.0.101:/home//Ubuntu/* $HOME/
(where 192.168.0.101 is the ip # of the old computer, and Ubuntu is the name of the old computer?

Reason for asking is that I don't understand how the new computer finds the old /home partition and folder.

Whichever it is, the authentication that will be requested presumably is for access to the /home folder on the old computer, and therefore should be the pw for the old computer?

Thanks,

TobiSGD 11-23-2010 07:42 AM

Use the second one and the password from your old computer.

To get the sshd running you first have to install it.
Code:

sudo apt-get install ssh
It should be started automatically. If you only use it for this purpose and maybe remove it after copying the folder I see no need to disconnect from the internet.

i92guboj 11-23-2010 07:53 AM

Quote:

Originally Posted by Odyssey1942 (Post 4168174)
i92guboj, I somehow missed yours yesterday (probably when I was typing up a reply).

Sounds simple enough for me to pull it off, but just to make sure I understand this:

on the old computer, go into terminal and type "sshd" (maybe sudo "ssd"?) (which I believe will cause the old computer to start listening for commands over the lan) (BTW, does this also cause the old computer to start listening for commands from over the internet, and if so, should I go offline from the I/N before issuing sshd?)

Complex question. What will sshd attend to depends on its config, usually under /etc/ssh/sshd_config. The firewall (iptables) is also an issue.

For max security, though, you should disable any external access while you are doing administrative stuff. That's always a good thing unless you are doing the administrative stuff from the outer side.

This also will ensure that no one else is logged in remotely operating concurrently over the same files you are operating. Concurrency is always a problem.

When you run sshd, it will surely tell you what config file it is using and some other info. It will also tell you if the daemon started correctly. That's the first step. Until that succeed you can't use ssh or scp from the other machines.

Quote:

Then from the new computer, I will go into terminal and issue the command:

scp -r root@192.168.0.108:/home/Intel-i3-550/* $HOME/
(where 192.168.0.108 is the ip # of the new computer, and Intel-i3-550 is the name of the new computer)
You don't use the name of the new computer there, "root@192.168.0.108:/home/Intel-i3-550/*" is the path to your source files. The home directory where the files reside in your OLD computer.

Assuming you use the same user name than you are using here, it would rather be like this:

Code:

scp -r root@192.168.0.108:/home/Odyssey1942/* $HOME/
It's the typical cp syntax,

Code:

scp <source> <destination>
Quote:

Reason for asking is that I don't understand how the new computer finds the old /home partition and folder.
I think this should be now clear. Ask again if you need more clarification.

Quote:

Whichever it is, the authentication that will be requested presumably is for access to the /home folder on the old computer, and therefore should be the pw for the old computer?

Thanks,
It's your login info. As we are using "root@192.168.0.108" then that would be the password for root. You don't strictly need root permissions, so you could very well just use "your_user_name@192.168.0.108", and use your password instead of the root one.

Odyssey1942 11-23-2010 06:40 PM

Dark Helmet, Guess I missed yours while I was typing my earlier. Thank you sincerely for such complete and easy to follow instructions. I do have a couple of questions, and:

to answer yours, the new machine will boot into 10.04 (dual boot with Windoze) and I do have a live CD.

The questions are:

Quote:

11. On the new computer, extract the archive into a temporary location--DO NOT just dump the archive on top of your existing home directory.
By "temporary location", I think we are talking about the new drive? The new drive has another partition which is at present unused and is EXT4. Can I use that, or is it better to use some existing folder within /, and if so, any that I should not use?

Once uncompressed, how are they best transferred to the new /home directory?

12/13. This is a bit worrying because I would have hoped to just move the whole kit and kaboodle over without needing to know that certain files and folders should not be moved. I would not know where to begin with the "nots", so can I just not copy anything that begins with a " . "? Is that going to create other issues?

----------------------

Also i92guboj, between my previous, yours and TobiSGB's, I am comfortable that I understand it.

----------------------

As you all can see, I am undecided about which route to go, and of course may wind up trying both of necessity.

Dark_Helmet 11-23-2010 07:11 PM

Quote:

Originally Posted by Odyssey1942
By "temporary location", I think we are talking about the new drive? The new drive has another partition which is at present unused and is EXT4. Can I use that, or is it better to use some existing folder within /, and if so, any that I should not use?

Once uncompressed, how are they best transferred to the new /home directory?

Yes, a temporary location on your new drive/computer. What I mean by "temporary location" is just somewhere that you have enough space to hold the extracted archive and is part of the filesystem (i.e. it is mounted somewhere, like /data). So yes, you can extract it to the unused partition as long as it's mounted. If that partition is mounted at /data, then you might do something as simple as make a new directory named /data/old_home and extract the archive into that directory.

Then you copy files like normal. Open up a GUI file manager and drag-drop or open a command line and "cp /data/old_home/<somefile> /home/username/<somefile>"

Quote:

Originally Posted by Odyssey1942
12/13. This is a bit worrying because I would have hoped to just move the whole kit and kaboodle over without needing to know that certain files and folders should not be moved. I would not know where to begin with the "nots", so can I just not copy anything that begins with a " . "? Is that going to create other issues?

In general, you'll be safe by copying over everything other than dot files. The only cause for concern with the dot files is that they're config files, and you just upgraded your software. The newer software may not recognize the older config files anymore. That is where the problems come in--when version 2 software tries to read version 1 config. Sometimes it will work, sometimes... not so much.

Dot files are hidden by default in the GUI file manager. So, you can "go to town" if you're copying files that way. There should be no problems. You have to manually update a setting to show hidden/dot files.


All times are GMT -5. The time now is 07:44 PM.