Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Hi I have a new notebook and I want to move my home data to the new computer.

I think there are multiple ways of doing this

  • copy all to a external hdd and move back on new computer
  • do an Deja-Dup backup and then restore on the new computer
  • rsyc/move to new computer via sshfs
  • ...?

My question is how do I keep the current ecrypt encryption of /home in place and get it working properly on the new computer. How do I have to install the new computer so I can use the encrypted home files from the old?

If I would use Deja-Dup do I need to worry about the ecrypt stuff on the old machine or does the new installation simply enctypt everything new?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Great question! I actually do this quite frequently (every few months). To do so, I use rsync to copy all of my /home partition/directory from the OLD machine to the NEW one.

First, ensure that you have openssh-server and ecryptfs-utils installed and running on the NEW machine.

sudo apt-get install openssh-server ecryptfs-utils

You could install your public SSH key in the root user's /root/.ssh/authorized_keys file. But I usually set a root password on the NEW machine.

sudo passwd

Also, on the NEW machine, create a new user, who's name and password precisely matches the name and password on the old machine.

sudo adduser YOURUSER

Make absolutley sure that YOURUSER is NOT currently logged into either the NEW machine or the OLD machine.

Now, from the OLD machine, as root, rsync your /home directory from the OLD to the NEW machine:

sudo rsync -aP /home/ NEW:/home/

Finally, make absolutely sure that the files on the NEW machine are owned by YOURUSER:

sudo chown -R /home/.ecryptfs/YOURUSER /home/YOURUSER

And that should do it! You should be able to login as normal to your NEW machine and read and write your data!

Full disclosure: I'm the author and maintainer of Ubuntu's Encrypted Home Directory feature.

share|improve this answer
    
ok I've used sudo rsync -aP /home/ notebook2:/home/ and it synced about 276000 files over night. Now I have to figure the chown command out... I assume I ssh into the new computer and run it as root@NEWMACHINE –  seb May 16 '12 at 8:59
1  
@seb if you are loged in as root on the new computer the chown command should look like this, i think: sudo chown YOURUSER:YOURUSER -R /home/.ecryptfs/YOURUSER /home/YOURUSER –  webwurst May 29 '12 at 9:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.