What is the best way to upgrade a primary hard drive (M.2 Drive)

I’d KISS:

  1. Make a list of all installed packages:
    1.1. All official packages from the repository:

    pamac list --installed --quiet --explicitly-installed > ~/installed.txt
    

    1.2. All foreign packages, like the AUR:

    pamac list --installed --quiet --explicitly-installed --foreign > ~/installed-foreign.txt
    
  2. Disconnect the current disk.

  3. (Re)connect the new disc, leaving the current one disconnected.

  4. Install Manjaro on the new, connected disk and make sure it’s bootable and everything is good.

  5. Connect the current one along with the new one, but be sure to boot from the new disk.

  6. Copy the current, now the older, previous drive’s home directory tp the new user’s.

    cp /mnt/<old_disk>/home/<userName>/* ~/
    

    Where:

    • /mnt/<old_disk> is the mount point where the previous disk is mounted; and
    • <userName> is the username of your current user on the older, previous installation.
  7. When done, reinstall all packages from the list previously backed up:

    • For the packages from the repositories:
      pamac install $(cat ~/installed.txt)
      
    • For the foreign packages:
      pamac build $(cat ~/installed-foreign.txt)
      

Of course, I don’t know if this’ll install any snaps or flatpaks currently in use, as I don’t have any so can’t test. But that’d be my steps. Also: this method can work with/on any file system, be it BTRFS, FAT, EXT4, or something else entirely.

2 Likes