Yes, this is all possible.
Firstly, it is a good idea to take a backup of your home directory, just in case - it's all too easy to make a silly mistake & be sorry!
Next, install the SSD & reboot from install media, do a normal installation, don't tell Ubuntu about your current SDA drive - be aware, the SSD may well go in as SDA so check carefully when you select the destination drive!
You can allocate /home during the install, but I always prefer not to (just paranoia!) - it's only one tick-box away from formatting it, and it keeps it safe..
Having got your new system up & running, mount the old drive; just double-click it's desktop icon - check the ownership of your old home directory matches - it probably does, unless you have multiple users. If it doesn't, shopt -s dotglob ; chown -R you:you /media/you/wherever
will fix it so it does. The shopt
command makes it include hidden files, & the chown
changes ownership to your new UID & GID.
Now, use `blkid /dev/sdx4' to get the UUID for your home partition, add it to /etc/fstab -
sudo vi /etc/fstab
or whatever editor you prefer
UUID=78995654kjhgjyt7896 /home ext4 defaults 0 1
- obviously, using your UUID & filesystem type here.
mount -a
should now replace your home directory with the old one, although a reboot is a better idea as you may get some odd effects if you just remount.
You can then delete your old system - /dev/sdx1, and sdx2 -others beware as that is sometimes an extended partition and may hold your home directory! Use gparted to expand into the free space.