____________________________________________________________________________________________________
EDIT:
After much testing it turned out to be necessary to perform some more actions for this to work. So I developed this app that does everything automatically.
Install: wget -O - https://raw.githubusercontent.com/xhente/omv-regen/master/omv-regen.sh | bash
DO A NEW OMV INSTALLATION AND KEEP THE SETTINGS
omv-regen
Copy and paste the following line into a terminal and run it as root or with sudo.sudo wget -O - https://raw.githubusercontent.com/xhente/omv-regen/master/omv-regen.sh | sudo bash
- STEP 1. Create a backup of the original system with omv-regen.
- STEP 2. Do a fresh installation of OMV on the disk you want and connect the original data drives.
- STEP 3. Use omv-regen to migrate the
____________________________________________________________________________________________________
Some time ago someone known to everyone on this forum said:
QuoteIt would be interesting to re-architect OMV plugins to be saltstack (or better yet - ansible ) code instead of .deb packages. Then you could run the "playbook" and it would install the packages and configure everything. That would make things easier.
It seems that this moment has arrived, OMV6 has already been working with salt for a year. So it occurred to me that thanks to salt maybe a complete OMV system can be recreated from scratch from the database xml file. I have put my hands to work and it has worked for me. I have managed to recreate an existing system from scratch with ease.
The procedure is simple. In short it consists of doing a fresh installation (update, install plugins, do not configure anything, just install) add existing users, replace the config.xml file, run two commands and reboot.
When the system boots it will be in the same state as we had it, all the GUI settings we had, file system, permissions, shared folders, services, scheduled jobs, rsync, plugin settings, etc will be in their original state.
Exceptions and points to consider:
- It is recommended to have the system as up-to-date as possible before extracting config.xml to copy it to the new system. Otherwise, the versions of some plugins may change and some inconsistencies may appear.
- All manual root settings outside of the GUI will be gone, as expected. If you have done this you already know what you have to do to recreate it.
- If you have shared folders in root, they will logically disappear. It is not advised to do this in general anyway.
- Podman based plugins (Filebrowser, Photoprism, Wetty) will be active and configured in the GUI. But the internal configurations of the container will have been lost.
- It is necessary to create the users again, they are not in the database. They're in /etc/passwd and the (encrypted) passwords are in /etc/shadow, but you'll end up doing it by hand first.
- The docker containers will be configured in openmediavault-compose, you only have to start them the first time. If you installed them with Portainer you will have to reinstall them.
- Some special plugins might lose settings. For example Openmediavault-KVM will lose the configuration of the vm. It can be fixed with backup copies of the xml files. If you had the proxmox kernel you must previously install it with the plugin.I don't know all the plugins so I can't make an exhaustive list here. But in general all will work except for some exceptions.
I think this could be used for an OMV plugin. It is only necessary to follow the working route. As I see it, a button in the GUI sets a different folder on disk to do the backup (config.xml file, user list and plugin list). Once the system has been reinstalled by the user, there is a button to regenerate the system, you only have to say in which folder the backup is. The system installs the plugins, generates the users and resets the database. It reboots and voila, new system.
As an example, in the following post is one of the tests I have done.