Software and data migration to a new computer

LaptopI have renewed my laptop after using my previous one several years. But what is remarkable is how easy it is to migrate both applications, its settings and the data from one computer to another one when you use GNU-Linux systems like Ubuntu, so that you can continue working in the new computer exactly as you were working in the old computer. Here you have some notes on how I did it.

Important note: Use these instructions under your own responsibility. The username and password have to be the same in both computers, and we assume that at the new computer you have installed exactly the same version than at the old one. First, to get a lista of all installed packages in the old computer, give the following command from a terminal at the old computer:

dpkg --get-selections > ~/Package.list This will create a file called "Package.list" at your home folder with a list of all installed programs. Next, we copy the list of repositories needed to reinstall the programs and the keys used to access them:
sudo cp -R /etc/apt/sources.list* ~/ sudo apt-key exportall > ~/Repo.keys This will copy us the file "sources.list" to our home folder and it will create another file called "Repo.keys" with all the keys. Finally, we have to copy all the contents of the home folder (that is all directories, subdirectories and files, also the hidden ones, or the /home/username folder of the old computer) to the home folder of the new computer, that if you remember has the same name as in the old computer. Use any procedure that you know to do this but make sure that you also transfer all hidden folders and files.

Next, we proceed to install all programs at the new computer (install "dselect" first):
sudo apt-key add ~/Repo.keys sudo cp -R ~/sources.list* /etc/apt/ sudo apt update sudo apt install dselect sudo dselect update sudo dpkg --set-selections < ~/Package.list sudo apt dselect-upgrade -y You should now have everything installed and configured exactly as you had it in the old computer. At least for me, it worked. Only a couple of hours after receiving my new computer, I was already working exactly as I was doing with the old one, I had even the same tabs opened in my browser that I had when i stopped working with the old computer.