You can, of course copy your data to an external drive and restore from there. You can also not do that and keep your data on your internal disk.
The deal is such: you can do this only if you've partitioned your drive a certain way. The configuration I'm familiar with and use is 4 separate partitions, but as far as I know this can work on as few as 2. I'll go over the configuration with 4.
The 4 paritions you'll need are as such:
Some research required to fit your own specifications! Suggestions are all over the place, but generally if you have little RAM then about double that should be the size of your swap partition. If you have plenty, then perhaps the same amount or even double.
You're going to have to do some of your own research to determine if you actually need one. I'm not very familiar with the differences between UEFI and EFI systems, but there's something to do with that.
If you do need to make one, then this'll be FAT32, about half a gig, and mounted at /boot/efi.
The minimum size I recall seeing for this was about 20 gigs, but I have heard of people having issues with that sort of size. Generally, about 50 gigs should be minimum. The format, if you don't know much about filesystems (like me), is EXT4. Mount this at / (the root, as it's called).
The bulk of your drive should be taken up by this partition, it's where you'll store all of your files. This is also EXT4, and mounted at /home.
Assuming your disk is set up as such, whenever you change your distribution of Linux, you can do the following:
Also! When you set up your new user account, keep your username the same as before!
I have noticed that deleting most of your dotfiles before doing this tends to help the situation after installing a new image. Keep the ones you know you want, but boot the rest. Some things might look weird or act weird on your new installation otherwise.
This article was written on 21/05/2024. If you have any thoughts, feel free to send me an email with them. Have a nice day!