DevHeads.net

Ubuntu to Arch complete data migration

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?
2- do I need to partition hard-drive of new PC exactly as old one?
3- will root and other user credentials stay the same?

Any other suggestion appreciated,

Comments

Re: Ubuntu to Arch complete data migration

By David Fletcher at 08/12/2019 - 15:09

On Mon, 2019-08-12 at 15:20 -0400, Matt Zand wrote:

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

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@laptopIPaddress:/home/laptopus
era/ /home/laptopusera/

Repeat for userb, userc etc.

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.

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

Re: Ubuntu to Arch complete data migration

By Wade Smart at 08/12/2019 - 14:26

You could just pull the hd out of your laptop
and put it in your pc. Yea, its physically smaller
and a lower rpm but you can get cable adapters
for this.