Migrating a non uefi to uefi machine

Hi Guys:
I currently have a great working old HP-Z400 WS with EOS Apollo (upgraded from neo) and running a TWM (xmonad). I am moving from the old machine (legacy BIOS) to a newer Dell 3620 (UEFI) machine. The old SSD is a 500GB and the new machine will have a 1GB SSD. The plan so far is to install a fresh Apollo install minimal without any DE base and Devel and use my list of installed packages from running pacman -Q > installed-pkgs as the input for pacman on my new system. Then copy all my .desktop files, a few usr/share (fonts and backgrounds) and my dot files to the new system from my old SSD. Will this make a “clone” with all the benefiuts of my UEFI system from old “legacy” system SSD. To add to the fun, I hope to drop GRUB and use SYSTEMD-Boot (no tp or egging please ;)) Help, as always, is appreciated and I have to wait for some drive adapter parts for the dell. Did play with the Apollo live environment on the new system. Have to stick to X11 though, with the new system got an NVidia M4000 (quadro) which it seems plays ok with EOS so far. My HP has an old ATI card in it.

               OS: EndeavourOS Linux x86_64
               Host: HP Z400 Workstation
               Kernel: 5.17.4-arch1-1
               Uptime: 25 mins
               Packages: 1511 (pacman)
               Shell: zsh 5.8.1
               Resolution: 1920x1080
               WM: xmonad
               Theme: oceanic [GTK2/3]
                Icons: Adwaita [GTK2/3]
                Terminal: alacritty
                CPU: Intel Xeon X5690 (6) @ 3.459GHz
                GPU: AMD ATI Radeon RX 460/560D / Pro 45
                Memory: 1022MiB / 15982MiB

Above is my current (legacy system) info from neofetch

Let me know if I am forgetting something. I think by running pacman -S << installed-pkgs…txt will do the iinstall from base /base-devel (have to look up the flag(probably -U, instead of -S, but will confirm that when it is time to do the actually migration from old drive (which will likely be hooked up externally via USB at that time on the new system (UEFI).

This should be
pacman -Qq > installed-pkgs

No, it wont. You should use:
pacman -S $(cat installed-pkgs)

And, by the way, “<<” starts a HERE document. https://bash.cyberciti.biz/guide/Here_documents

Why dont you maintain customized .desktop files in $HOME/.local/share/applications ?

I suggest you test your scenario in a virtualbox first.

Some further reading here:



Thank you guys. I have read both those suggested Archwiki pages, though I admit it has been some time ago.

Thank you for the clarification and I can correct my installed-pkgs.txt file using the suggestion for -Qq switches. I did think of one thing, can’t remember how much AUR is installed and I know at least 3 AUR packages were installed via git clone. One of them is Zramd which is easy enough.

Is there a way to see what has come from the AUR or is that listed via pacman-Q as well. Pikaur is my installed helper. Also .local/share is used but the system seems to put fonts and backgrounds into /usr/share and *.desktop files into the global applications folder under the /usr/ (local iirc).

Anyhow, still prepping for transition and VM is not going to be possible as I did not install any VM software and feel the 11 year old HP would be very dog slow. :blush:

Thanks again for the responses.

pacman -Qqm


yay -Qqm

Looks like it will list other “foreign” packages installed from other sources as well and not only the ones from AUR:

-m, --foreign list installed packages not found in sync db(s)

See: pacman -Q --help for more info.

“The system” is doing that? You mean pacman? If that is the case you do not need to bother to manually copy anything. You just need to install the packages.

While doing a fresh installation is a cleaner and better migration tactic, I just want to add the scenario of the simple conversion of a BIOS/Legacy to UEFI system by doing only the basic changes.

  • copy/rsync drive contents, keeping attributes (more than one method for this)
  • boot ISO in UEFI mode, chroot and install chosen bootloader (grub, systemd-boot, refind)
  • boot to new system with free/modesetting drivers and if desired, install nvidia proprietary

Nevertheless, I suggest not using this method :laughing:


After creating an ESP of appropriate size for Grub or systemd-boot :slightly_smiling_face:


Yeah but moving to a bigger SSD as well so would need to move drive contents anyways. Do appreciate it.

@mbod regardless of whether it is system or pacman the new fonts and wallpapers default to /usr/share in their respective folders. So instead of me having a .local copy (which some fonts I downloaded manually actually reside in) I will still need to copy the backgrounds and fonts folders from /usr/share/ to a fresh system. If you can tell me how to change this behavior and keep them in my $HOME folder .local instead of system wide, then I am interested as it would mean I wouldn’t have to sudo to add wallpapers for instance. I do thank you for help.

I also forgot to mention that a lot of my wallpapers were manually downloaded from the Internet and some have been on my system since ~1994. Those used to reside in .wallpapers in my home directory but if I install any from AUR or even default wallpapers from repositories, they will end up in /usr/share/backgrounds/ . So I simply move all wallpaper images there too,

BTW: the defaults I described are the same on vanilla Arch.

Whatever is installed with system utilities (pacman, knewstuff etc) just install with the same way. The used installation paths are OK.
For your other questions, read this to clarify how system/local paths work

My point was, that if pacman or the EOS system has placed the background pictures and fonts in /usr folders you do not need to copy them manually to a new laptop. You just need to install the same packages on the new laptop.

Only the /usr/local directory is for manual installations. Everything else in /usr is from pacman packages

1 Like

Hi @mbod : I think you are mis-understanding what I am saying on my end. Here is what I did on my system following the Archwiki on XDG page (https://wiki.archlinux.org/title/XDM[Archwiki XDG Page] and created /usr/share/backgrounds/ as the page says and moved all my own (not pacman installed) wallpapers there. Same with fonts from .fonts in my home directory, therefore, on a fresh system, pacman will NOT have these wallpapers and most fonts in the packages or the repos. Hope that sort of clarifies what I am trying to convey. I t appears that pacman now uses that location as well as wallpapers installed from repos ended up there too. Again appeciate the help.

Did solve the listings I wanted AUR using pacman -Qqm and Native using pacman -Qqn as @pebkak suggested from the tips and tricks archwiki page.

1 Like

Good luck with the migration @IainNitro !

Let us know how it went.


Personally, I wouldn’t do it like that, because that will reinstall all packages as explicit.

It is, in my opinion, better to do the following:

pacman -Qqen > packages.txt
pacman -Qqem > foreign-packages.txt

Explanation of the options:
-Q list installed packages
-q do not list version numbers
-e show only explicitly installed packages
-n show only packages that are in the repos
-m show only foreign packages

And then, on the new install:

sudo pacman -S --needed - < packages.txt

(no need for :cat:)

This way, only the explicitly installed packages are listed, and when you install them on the new system, pacman will automatically install all of their dependencies as such, so that if they become obsolete, they will correctly be marked as orphans.

For AUR, I would go through the list of all packages in the created foreign-packages.txt file above, and install them with yay, one by one. Automating installing a large number of AUR packages is not the greatest of ideas, in my opinion.

@Kresimir Thank you, I think that your suggestion will accomplish what I want other than making sure my custom fonts and backgrounds (wallpapers) get moved back into $HOME in .fonts and .wallpapers from /usr/share I think I need to do a fc-list on the new system after fresh install (fc-list > installed-fonts and perhaps diff that against my list on my current system to what fonts are installed by pacman?)

The wallpapers are readily apparent as I copied all my wallpapers into sub folders in /usr/share/backgrounds .

I am wondering if XDG standard has a default for wallpapers to go into something like .local/share/backgrounds? (in $HOME folder)

No, not really. Package management on Arch Linux should leave the user space alone.

My suggestion was merely to avoid explicitly installing packages that are, in actuality, dependencies of other packages.

I don’t think so. I usually keep them in ~/Pictures/Wallpapers, but if you want to, you can keep them in ~/.local/share/backgrounds… Any place is fine, really.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.