Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install (Read 1180 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

I was just thinking, is there a way to keep all my current settings, configurations. installed software, drivers.... etc. on a flash disk for example or on a cloud storage so that if I get a new machine, or reinstall the same or install a new release I can just retrieve (from the flash disk or the cloud storage) the aforementioned without having to do it all over again one by on?

If there is a way it would be great.

Any ideas how I can do that (if it can be done)?, assuming hardware is the same.
P.S. My humble knowledge Endeavour has a software to detect the hardware during installation and install drivers... etc. accordingly.
Anything similar in Artix? Can Artix use this software (it's Open Source anyway).?

P.P.S. I am not by any means interfering with the developers business. They are doing a great job.
I'm just thinking loud with the community.

Thank you.
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

 

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #1
This sort of thing is certainly possible, the examples that immediately spring to mind are things like LARBS and DTOS.

They are both just shell scripts that automate the more, mundane parts of a an install (specifically, after you have installed everything using the base instal ISOs).

In principle, all they are doing is what you asked for really, they install a pre-defined list of packages, then pull down from a remote repository a bunch of configuration files and then move them to the correct location. Although the specific packages and configurations vary greatly based on the author.

And if you think about it, this is all the Calamares installer is (although also combined with the actual installation process), it automatically sets up a user, installs a buch of pre-defined packages and then pulls down some config files with some basic config settings.

Could, as you ask, a generic one exist? Probably not, although I know, for example, LARBS allows you to supply your own config files for the installed programs, in general people are very varied in what programs they use, you wouldn't end up automating much, so that you weren't too opinionated.

It would be very tough to make a script that automates everything for someone who uses mainly suckless programs AND someone who wants to use KDE AND someone that wants to use openbox.

Invariably these 'deployment scripts' you will find online are basically someone saying 'Hey I've automated my post install configuration, you can use it if you want', and they have varying levels of polish.

That being said, if you want to implement something like this for yourself (I will for myself, eventually, one day, I promise) then I highly encourage you to look at the various scripts online to get an idea of what works.

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #2
Thank you @Krellnus

I will look at software you mentioned and see how they might be used.
I don't mind installing default system, then insert a flash disk or define a cloud, run a script and get my previously installed system with its configs and installed software automagically.

I don't mean of course letting the installer do it for me. It will be much work for developers that during installation it looks at my previous config/install and do it for me. I'm not that lazy.

I'll see how they work.

Thank you.
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #3
Use cp -a or rsync to copy everything except stuff like /dev /proc /tmp/ /run /var/run /media and /mnt and so on then copy it onto the new partition, edit /etc/fstab, chroot in, swap any hw specific packages as required for the new hardware, reinstall the kernel which will run mkinitcpio, set up grub, should boot and work, may have to tweak it a bit but usually this is not too difficult. So you can basically copy your entire install as it exists now. Or do another equivalent install with the same desktop and software then copy across /home and add any other config in /etc as required. It can sometimes be an advantage to do a fresh install and add config manually though, when you have a longstanding installation, as it's a good way to get rid of any obsolete stuff that may have accumulated.


Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #5
they install a pre-defined list of packages, then pull down from a remote repository a bunch of configuration files and then move them to the correct location.

Ah, both are like thinking and doing for me. Not exactly what I need. (I just remembered now, when you get a new iPhone, start it with your previous Apple ID, apple knows what software and configurations you had on your old iPhone and automagically replicates the old one to the new one)

Instead of letting Arch servers keep everything, I'd rather put it on a flash disk or a cloud storage and do the same.
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #6
Thanks @strajder
I had a "speed reading" to the link, it seems to be what I am looking for.
Hopefully it won't be so techie or complicated for me.

I'll go through it and see how it goes.

Thank you very much.

mmm...
Quote
Currently, <profile> can be either base (default) or lxqt
I'm a KDE guy :(
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #7
I found https://wiki.archlinux.org/title/migrate_installation_to_new_hardware
 for any of the two ways.

I found this link as well, but I can't comment... 
http://positon.org/clone-a-linux-system-install-to-another-computer

Maybe this? https://bbs.archlinux.org/viewtopic.php?id=139680
I believe some experienced user can make a script to do all commands.

With my little tech-know-how I can settle for installing the KDE ISO then
Quote
$ pacman -Qqen > pkglist.txt
$ pacman -Qqem > pkglist_aur.txt

Then
Quote
pacman -S --needed - < pkglist.txt
pacman -S --needed - < pkglist_aur.txt

Maybe copying all hidden files and folders in /home can help as well?

then reinstall WiFi as I inquired in a previous thread.

Would that be enough?
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #8
Use cp -a or rsync to copy everything except stuff like /dev /proc /tmp/ /run /var/run /media and /mnt and so on then copy it onto the new partition, edit /etc/fstab, chroot in, swap any hw specific packages as required for the new hardware, reinstall the kernel which will run mkinitcpio, set up grub, should boot and work, may have to tweak it a bit but usually this is not too difficult. So you can basically copy your entire install as it exists now. Or do another equivalent install with the same desktop and software then copy across /home and add any other config in /etc as required. It can sometimes be an advantage to do a fresh install and add config manually though, when you have a longstanding installation, as it's a good way to get rid of any obsolete stuff that may have accumulated.
Thanks @######
You are giving more ideas.
And you are right, of course a fresh install is better.
I will take note of the folders you recommended, copy them then paste them in the new system (if any).

I think your way plus my previous post will almost "clone" the old system without going through it all one by one.

What you think guys?
System:  Kernel: 6.4.10-artix1-1 , KDE Plasma 5.27.7, HP Spectre x360 Convertible 13-ae0xx
Dual Core  i7-8550U bits: 64
8 GB Ram - SSD:  (250 GiB), BTRFS

Re: Restore Settings, Config., Installed Software... etc. After A New/Fresh Install

Reply #9
Cloning my Devuan partition recently, I used an HDD enclosure to partition and format the drive with gparted from Artix, I also did a fresh Artix base install like that directly from Artix, I made some notes which I cannot say for sure are 100% complete, but I really don't think there was much more to it than this to copying Devuan, I think I had to chroot in and redo a kernel install or mkinitcpio once it was in the target machine rather than the enclosure on Artix to get it to boot initially, can't remember exactly. But it's pretty simple as you can see, if the system isn't "running" then /dev and /proc and so on are just empty directories so you can copy the lot. You might need some more / different steps for uefi, extra partitions for /boot or /home depending on your setup.
Code: [Select]
cp -a entire partition to new one

modify /etc/fstab

chroot in, (Artix to Artix you can simply use "artix-chroot" from artools package instead of mount bind)
$ sudo mount /dev/sdb5 mnthome/
$ for d in dev sys run proc; do sudo mount --bind /$d ~/mnthome/$d; done
$ sudo chroot ~/mnthome
# bash
# update-initramfs -c -k all
updates all installed kernel initramfs

# exit
# exit
$ for d in dev sys run proc; do sudo umount -r ~/mnthome/$d; done

Chrooting from Artix, PATH is wrong and needs some extra entries (this part is just due to it being Devuan not Artix):
export PATH="$PATH:/bin:/usr/sbin/:/sbin"

Boot error, even after redoing initramfs:
ALERT! UUID=xyz123blahblah does not exist. Dropping to a shell

Perhaps I should check fstab, reinstall kernel? That was the old UUID from the previous HDD, when I checked it.
That last bit was because I needed to run update-grub chrooted into Devuan then update-grub in Artix  (the main grub that has been grub-install'd), because the Artix grub os-prober took the entries from the other /boot/grub/grub.cfg including the UUID which was wrong, as it was still pointing to the old HDD that it was copied from.