[How to] Migrate/Restore OMV Settings to Another System with omv-regen

    • Offizieller Beitrag

    UTILITY TO MIGRATE OMV CONFIGURATION TO ANOTHER SYSTEM OR
    DO A NEW OMV INSTALLATION AND KEEP THE SETTINGS



    Si quieres leer todo esto en español puedes hacerlo en github


    omv-regen

    INSTALLATION:

    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 settings from the original system to the new system.


    omv-regen_7_eng.jpg omv-regen_7_esp.jpg


    WHAT IS OMV-REGEN

    • omv-regen is a command line (CLI) utility that is used to migrate/regenerate the configurations made in the graphical user interface (GUI) of one openmediavault (OMV) system to another OMV system. It is a script made in bash.
    • omv-regen is divided into two main functions, both integrated into a graphical user interface, omv regen backup and omv-regen regenera.
    • omv-regen backup -> makes a backup of the configurations made in the GUI of the original OMV system. The files necessary to perform a system regeneration are packaged in a tar file, primarily the database and some other system files, as well as others generated by omv-regen that contain necessary system information.
    • omv-regen regenera -> regenerates all the OMV GUI configurations of the original system on a new OMV system from the backup made with omv-regen backup. It requires previously performing a clean installation of OMV, preferably on a different disk or pendrive.

    WHAT OMV-REGEN IS NOT

    • omv-regen is not a utility for scheduled backup and restore of the operating system at any time. If you need an openmediavault backup that you can restore at any time, use the openmediavault-backup plugin. The reason for this is explained in detail in the "Limitations of omv-regen" section, but the summary is that you need an updated backup to be able to restore with omv-regen.
    • Alternatively, you can regenerate the system on another drive, for example a pendrive, and continue using the original disk/pendrive, which would provide you with a usable backup at any time.

    OMV-REGEN IS USEFUL FOR

    • Reinstall openmediavault on a new disk or new hardware keeping the configurations.
    • Migrate openmediavault between different architectures, for example from a Raspberry to an x86 system or vice versa, but be careful, not all plugins are compatible with all architectures.
    • Get a clean installation of openmediavault after a change of openmediavault versions. If, for example, you update OMV5 to OMV6 and the update causes problems, omv-regen can move the configuration to a clean system.
    • Reinstall the system if it has become unstable for any reason, as long as the database is healthy and the system can be updated to the latest available version.
    • You can get a working system with your current configuration and still use the original system. Just regenerate your system on a pendrive for example. That will provide you with a real backup of your system.

    LIMITATIONS OF OMV-REGEN

    • Configurations made in CLI will not be carried over to the new system, they will be lost and you will have to make them again. omv-regen does the regeneration from the OMV database, and this database only stores the configurations that have been made in the GUI. An average user will configure everything using the OMV GUI but an advanced user doing custom configurations in the CLI should keep this in mind.
    • The openmediavault and plug-in versions must match on the original system and the new system. To ensure this omv-regen will update the original system before doing the backup and will update the new system before regenerating. It may happen that between the backup and the regeneration, an update occurs in the OMV repositories. In this case, if the versions of openmediavault or one of the essential plugins (related to file systems) do not match, the regeneration will stop. In this case you must return to the original system and make a new backup. If that happens with any other non-essential plugin, the plugin will be installed but its configurations will not be applied, the regeneration will complete but leaving that plugin ready to be manually configured in the OMV GUI.

    HOW TO USE OMV-REGEN

    The basic procedure is summarized in three steps, create a backup, install OMV, regenerate the OMV configuration.

    • STEP 1. Create a backup of the original system with omv-regen.
      • Log in via ssh on the original system, for example with putty.
      • Install omv-regen on the original system. Run -> sudo wget -O - https://raw.githubusercontent.com/xhente/omv-regen/master/omv-regen.sh | sudo bash
      • Run the omv-regen command and follow the GUI prompts to create a backup. Check the option to update the system before making the backup. omv-regen will create a tar archive containing the files needed to regenerate the system. If you have optionally chosen a folder, another compressed file will be created for each folder chosen. The files in each backup are labeled in name with date and time.
      • Copy the backup to your desktop, for example with WinSCP. The backup file is very small and moves instantly.
    • STEP 2. Do a fresh installation of OMV on the desired disk and connect the original data drives.
      • Install openmediavault on a disk or pendrive different from the original one. Keep the original disk, this way you can return to the original system at any time.
      • Turn off the system. Connect the data disks. Start the system. Don't do anything else, don't configure anything.
    • STEP 3. Use omv-regen to migrate the settings from the original system to the new system.
      • Log in via ssh to the new system, for example with putty.
      • Install omv-regen on the new system. Run -> sudo wget -O - https://raw.githubusercontent.com/xhente/omv-regen/master/omv-regen.sh | sudo bash
      • Create a folder on the new system and copy the backup to that folder, for example with WinSCP.
      • Run the omv-regen command and follow the GUI prompts to do the regeneration. You can choose not to configure networking or not install the proxmox kernel if it was installed on the original system. A reboot may be required during the process, if so omv-regen will ask you to do so, after the reboot run omv-regen again, the process will continue automatically.
      • omv-regen will reboot the system when the regeneration is complete. Access the OMV GUI in a browser and check that everything is as you expected. If you cannot access press Ctrl+Shift+R to clear the browser cache, if necessary repeat it several times.
    • The result of the regeneration will be the following:
      • All configurations made in the OMV GUI on the original system will be replicated on the new system. This includes users and passwords, filesystems, docker and containers configured with the compose plugin, etc. Make sure that the persistent data in the containers resides on a separate disk, if it is on the operating system disk you must include that folder in the omv-regen backup if you do not want to lose it.
      • It does NOT include any configuration done in CLI outside of the OMV GUI. Use other means to support that.
      • Does NOT include containers configured in Portainer. You will have to recreate them yourself.
      • Filebrowser and Photoprism plugins are podman containers. They will not be backed up, use other means.

    OMV-REGEN FEATURES

    1 - omv-regen - Opens the graphical interface with the configuration and execution menus for any omv-regen function. The GUI will guide you to run a backup or regeneration.


    2 - omv-regen backup - Performs a very light backup of essential data to regenerate the configurations of an OMV system. You can include optional folders, even from your data disks, and define the destination. You must previously configure the backup parameters in the omv-regen GUI, once configured you can run omv-regen backup in the CLI or schedule a task in the OMV GUI to automate backups.


    3 - omv-regen regenera - Regenerates a complete OMV system with its original configurations from a fresh OMV installation and the backup of the original system made with omv-regen backup. Run omv-regen on the command line and the interface will guide you to configure the parameters and run the regeneration. Then you can run it from the menu or from CLI with the command omv-regen regenera


    4 - omv-regen help - Access to dialogs with full omv-regen help.

    SOME ADVICES

    • OPTIONAL FOLDERS: If you choose optional folders make sure they are not system folders. Or, if they are, at least make sure they won't harm your system when copied to the OMV disk. It would be a shame to break the system for this once regenerated.
    • FILEBROWSER AND PHOTOPRISM PLUGINS: If you use the Filebrowser or Photoprism plugins or any other based on podman you should find alternative means to back them up, omv-regen will not support them. omv-regen will install them and regenerate the OMV database configurations, this includes the OMV GUI configurations, shared folder, plugin access port, etc. But the internal configurations of the two containers will be lost. It may be enough to include the folder where the container database resides so that omv-regen will restore it as well. This does not guarantee anything, it is just an untested suggestion.
    • OPENMEDIAVAULT-APTTOOL: If you have a package installed manually, for example lm-sensors, and you want it to also be installed at the same time you can use the apttool plugin. omv-regen will install packages that have been installed using this plugin.
    • OPENMEDIAVAULT-SYMLINK: If you use symlinks on your system omv-regen will recreate them if they were generated with the plugin. If you did it manually in CLI you will have to do it again in the new system.
    • DO THE REGENERATION IMMEDIATELY AFTER THE BACKUP: You must make the backup and immediately do the regeneration to avoid differences between package versions. See Limitations of omv-regen.
    • DIFFERENT SYSTEM UNIT: It is highly recommended to use a different system drive than the original one to install OMV on the new system. It is very easy to use a pendrive to install openmediavault. If you are unlucky enough that an update to an essential package is released between the time of the backup and the time of the rebuild, you will not be able to finish the rebuild, and you will need the original system to make a new updated backup.
    • DOCKER CONTAINERS: All the information on the original system disk will disappear. To keep your docker containers in the same state make sure you do a few things first. Change the default docker installation path from the /var/lib/docker folder to a folder on one of the data disks. Configure all container volumes off the system disk, on one of the data disks. These are general recommendations, but in this case even more so, if you don't do it you will lose that data. Alternatively you can add optional folders to the backup.

    THREAD FOR QUESTIONS ABOUT OMV-REGEN

    If you need to ask any questions about omv-regen you can do so in this thread: Questions about omv-regen

    GITHUB

    • If you are interested in how the script works on github there is a schematic of how regeneration is applied. It is in Spanish but there is little text, it is easy to understand for someone who speaks English.


    ACKNOWLEDGMENTS: Thanks to Aaron Murray (ryecoaaron) for his advice on developing omv-regen.

  • chente

    Hat das Thema freigeschaltet.
    • Offizieller Beitrag

    OMV-REGEN BACKUP OPTIONS

    • BACKUP FOLDER PATH: This folder will be used to store all the backups generated. By default this folder is /ORBackup, you can use whatever you want but do not use the data disks if you intend to do a regeneration, they will not be accessible at that time. To do a regeneration it is better to copy the backup directly to your desktop with WinSCP or similar and then copy it to the new system. In this folder omv-regen will create a tar-packaged archive for each backup, labeled with the date and time in the name. If you have included optional folders in the backup, additional files will be created, also packaged with tar and labeled user1, user2,... The subfolders have the ORB_ prefix in their name. If you want to keep a particular backup version and not have omv-regen delete it, you can edit this prefix to anything else and that subfolder will not be deleted. You can use omv-regen backup to schedule backups with scheduled tasks in the OMV GUI. The saved settings will be applied. A full backup with two optional folders made on October 1, 2023 at 10:38 a.m. could look like this:
      • ORB_231001_103828_regen.tar.gz <-- File with regenera information
      • ORB_231001_103828_user1.tar.gz <-- File with optional user folder 1
      • ORB_231001_103828_user2.tar.gz <-- File with optional user folder 2
    • DAYS BACKUPS ARE KEPT: This option establishes the maximum number of days to keep backups. Every time you make a backup, all those existing in the same path that are older than the configured one will be eliminated, by scanning the files of all the files with the ORB_ prefix. A value is established in days. The default value is 7 days.
    • UPDATE SYSTEM: This option will cause the system to update automatically just before performing the backup. Make sure it is active if your intention is to make a backup to proceed with a regeneration immediately afterwards. Disable it if you are doing scheduled backups. The set value must be Yes/on or No/off.
    • ADDITIONAL FOLDERS: You can define as many optional folders as you want that will be included in the backup. Useful if you have information that you want to transfer to the new system that you are going to regenerate. If you copy folders with system settings you could break it. These folders will be returned to their original location in the final part of the regeneration process. A compressed tar file is created for each folder labeled the same as the rest of the backup. You can include folders that are located on the data disks. Since the restoration of these folders is done at the end of the process, at that point all file systems are already mounted and working.

    OMV-REGEN REGENERA OPTIONS

    • SOURCE BACKUP PATH: In the menu you must define the location of this folder. By default it will be /ORBackup but you can choose the location you want. This folder must contain at least one tar file generated with omv-regen. Before executing a regeneration, the program will check that this folder contains all the files necessary for the regeneration. When you define a path in the menu omv-regen will scan the files in that path and look for the most recent backup. Once the backup is located, omv-regen will check that all the necessary files are inside. If any file is missing, the route will not be considered valid and you will not be allowed to continue further.
    • INSTALL PROXMOX KERNEL: If the original system had the proxmox kernel installed you will have the option to decide if you want to also install it on the new system or not. When regeneration is running, if this option is enabled it will install the kernel mid-process. At that point omv-regen will ask you to reboot the system. After that you have to run omv-regen again and the regeneration will continue from the point where it stopped. Keep in mind that if you have a ZFS file system or use kvm it is recommended to have this kernel installed, otherwise you could have problems installing these two plugins. If you disable this option the proxmox kernel will not be installed on the new system.
    • REGENERATE THE NETWORK INTERFACE: This option is used to skip regenerating the network interface. If you deactivate this option, the network interface will not be regenerated and the IP will remain the same as the system's after the reboot at the end of the process. If you activate this option, the network interface will be regenerated at the end of the regeneration process. If the original IP is different from the current IP you will need to connect to the original IP after the reboot to access OMV. The menu tells you what this IP will be before starting the regeneration. When the regeneration ends you will also have it on the screen but you may not see it if you are not attentive.
    • Offizieller Beitrag

    OMV-REGEN 2.0

    • omv-regen now has a GUI using dialogs. All functions are integrated into the GUI.
    • Settings are now persistent, no need to set parameters every time.
    • The omv-regen backup command is now sufficient for scheduled tasks once the parameters are configured in the omv-regen GUI.
    • Backup is now tar-packaged, making it easier to move from one folder to another and ensuring permissions are maintained.
    • Improvements in regeneration control, better workflow control.
    • During regeneration backports are activated if necessary to install a plugin.
    • Controls before start and help in configuration. If it is not correctly configured, regeneration is not allowed to start.
    • The reboot service has been removed, now if a kernel is installed it must be rebooted manually. This guarantees visualization of the process.
    • If it must be restarted during regeneration omv-regen will record the state of the process to automatically start where it stopped.
    • If there is a power outage or any other problem you can run omv-regen again and it will continue where it stopped wherever.
    • Selection of plugins according to whether or not they are essential. If there is an update to a non-essential plugin the plugin will be installed and not regenerated, but system regeneration will continue.
    • Integrated system to automatically notify or update omv-regen at the user's choice. If a regeneration is in progress, omv-regen will not be updated until the system regeneration is complete.
    • Free choice of optional folders that are included in the backup.
    • More generous help content.


    omv-regen 2.0.jpg

  • chente

    Hat den Titel des Themas von „[How to] Backup and Restore OMV Configuration with omv-regen“ zu „[How to] Migrate/Restore OMV Settings to Another System with omv-regen“ geändert.
    • Offizieller Beitrag

    OMV-REGEN 7.0

    • omv-regen now supports Openmediavault versions 6.x and 7.x
    • Added support for new OMV7 plugins.
      • openmediavault-diskclone
      • openmediavault-hosts
      • openmediavault-iperf3
      • openmediavault-md
      • openmediavault-mounteditor
      • openmediavault-podman
      • openmediavault-webdav
    • Selective installation of omv-extras depending on the Openmediavault version.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!