DEV Community


Posted on

Migrating Linux to a new PC

I had an official Lenovo IdeaPad 320 craptop which I had used for 6 months before the beast finally arrived. The Omen 15-dc0151nia.

By the way, things are not always what they seem when it comes to electronics. Beware of what you buy. More on that in a future article.

I expected that I was going to have to figure out how to export my configuration for all the various apps I had installed, ESPECIALLY my gnome extensions and custom config.

I spent some time learning a few new things about the gsettings command-line tool. But I ended up not using it.

All I had to do was COPY MY HOME FOLDER! Errrr, and my /opt folder too.


I had earlier replaced the hard disk in the Lenovo (only because I thought the previous one was a problem, I know better now) with one I bought. So I took it out, put in a external HDD enclosure and plugged it in.

Then, I fired up my Bash terminal (Heard some noise about zsh, haven't given it a thought though), and ran

sudo rsync -ah --progress <source> <destination>
Enter fullscreen mode Exit fullscreen mode

to copy from my home folder in the hard disk to my new home (πŸ˜‰).

-a means copy EVERYTHING in the directory, down to the last detail, except hard links.
-h means output all numbers in human-readable format. Leave this one out if you are a fifth generation computer.
--progress gives you a copy progress report for every copied file

Oh and, use rsync. cp doesn't give you a lot of the goodies.

Afterwards, I did same for my /opt folder then did a reboot, and voila! Everything was there.

But there was a problem. A very unexpected one. Chrome (! 😭) refused to load the second profile in my chrome data. So I manually did a cloud resync from the old hard disk, after booting directly from it with another PC (also possible with same PC), and then sync the cloud data to the new PC. Also, extension data went missing. So I manually exported it from the old 'PC' and imported it to the new one.



Top comments (0)