Ubuntu to Arch complete data migration

David Fletcher dave at thefletchers.net
Mon Aug 12 20:09:39 UTC 2019


On Mon, 2019-08-12 at 15:20 -0400, Matt Zand wrote:
> I want to move all my files and folders from a Ubuntu laptop to
> another brand new computer (ubuntu OS). I have localhost with web
> server (Apache, PHP, etc). I want to clone everything including
> users. 


> My questions
> 1- what is the easiest way to do this?

My method. There may be as many methods as users!

> 2- do I need to partition hard-drive of new PC exactly as old one?

No, install the latest LTS distribution with your desktop of choice and
a named administrator account of your choice.

On the new system put your private SSH key into admin/.ssh/id_rsa

On the laptop put your public key into /root/authorized_keys

On the new system
sudo mkdir /home/laptopusera
rsync -av --delete-after --progress root at laptopIPaddress:/home/laptopus
era/ /home/laptopusera/

Repeat for userb, userc etc.

> 3- will root and other user credentials stay the same?

On the new system, edit /etc/passwd, /etc/group and /etc/shadow to copy
in the appropriate entries for usera, userb etc. to match those on the
laptop.

Reboot.

sudo chown -R usera:usera /home/usera
etc.

Your users should then be able to log in to the new system with the
same password as on the laptop. You don't need to know the passwords,
just the hashes which are kept in /etc/shadow.

> Any other suggestion appreciated,

Others will probably disagree with me but this is basically what I have
done multiple times on both desktop and my server.

You might like to remove the .ssh entry from the laptop /root/ when
you're done.

Dave F


> 
> -- 
> Cheers,
> 
> Matt Zand
> Cell: 202-420-9192
> Work: 240-200-6131
> High School Technology Services
> DC Web Makers
> Coding Bootcamps
> 
> -- 
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/l
> istinfo/ubuntu-users




More information about the ubuntu-users mailing list