Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have Roon database in separate directory when installing Roon Server #4897

Closed
wants to merge 1 commit into from

Conversation

JanKoudijs
Copy link
Contributor

Status: Ready (from my side)

  • Confirmed the issue with current version
  • Confirmed that with this change the issue is no longer there

References:
https://community.roonlabs.com/t/dietpi-server-on-nuc-update-issue/173775
https://community.roonlabs.com/t/after-updating-roon-on-dietpi-os-loss-of-database/95179
https://dietpi.com/phpbb/viewtopic.php?t=7543

Commit list/description:

  • DietPi-Software | Have Roon database in separate directory when installing Roon Server

Hi DietPi team,

There are multiple reports, both in the Roon and Dietpi community, that when Roon Server is installed in DietPi (x86) and the Roon Labs team pushes an update of the Roon Server that the database gets destroyed. Reports are listed in References.

It turns out that having the database in the installation directory is causing this issue. This PR modifies the service file and uses a separate directory in /mnt/dietpi_userdata. During uninstall I keep the database, in case it was unintentional, this is reported to the user with a G_DIETPI-NOTIFY.

Remarks, suggestions, questions are welcome.

Best regards,
Jan Koudijs

@MichaIng
Copy link
Owner

Many thanks!

We additionally need to either migrate the existing database on next DietPi update or on software reinstalls.

Actually, following other software install conventions, we should change the install dir to /opt/roonserver so that data/configs stay at /mnt/dietpi_userdata/roonserver 🤔. If we already touch this and implement a migration, then I would like to align it with other software options the way to do it nowadays.

@JanKoudijs
Copy link
Contributor Author

we should change the install dir to /opt/roonserver

That's indeed the better option. I had a quick look but could not find an install convention and therefor picked /mnt/dietpi_userdata.

We additionally need to either migrate the existing database on next DietPi update or on software reinstalls

Yeah, that would be great, question is what it takes to separate the database from the rest of the installation. My (simple) take on this was to drop the database for one last time and then have it fixed for all future updates.

The question is also how many users are affected by this bug? Based on some of the reactions in the threads few users are aware that you can run DietPi on x86, therefor this number might not be too high.

@MichaIng
Copy link
Owner

Indeed we have a very low reported install count for the Roon Server. These issues with the internal updater may however be a reason for this, also since it is present for quite a while.

However, even that it is a low install count, still nice to gracefully migrate existing installs, I can implement this tomorrow. Btw, are there any other variable files, like configs, stored outside of the ROON_DATAROOT? I'll do some testing but somethings things appear only after a while or when using certain features. When the updater purges the installation directory, I guess it is sufficient to change ROON_DATAROOT only, but probably there are other variable files elsewhere which would then be nice to have all in one place.

MichaIng added a commit that referenced this pull request Oct 26, 2021
+ DietPi-Software | Roon Server: Resolved an issue where the internal updater purged all Roon Server data and configs, since the data directory was located within the install directory. Roon Server will now be installed to /opt/roonserver while the data directory remains at /mnt/dietpi_userdata/roonserver. This change will be applied via DietPi update as well, your data and configs will remain untouched. Many thanks to @JanKoudijs for reporting this issue and providing a solution: #4897
+ DietPi-Software | Roon Server: Set ROON_ID_DIR environment variable in systemd unit, like it is done by the official installer
+ DietPi-Software | Roon Server: Merge install and config code blocks
@MichaIng
Copy link
Owner

MichaIng commented Oct 26, 2021

Since I needed to apply changes to other files as well (which I cannot do on remote branches), I did it now all here: #4903
Roon Server is now installed and as well reinstalled on next DietPi update to /opt/roonserver while the database (all data, configs and logs) remain where they are. During DietPi update, after the reinstall, the 3 directories and 3 files from the Roon Server archive are removed from /mnt/dietpi_userdata/roonserver, so that should be safe. The only concern I have, if the reinstall is done from a very old Roon Server instance, whether it will migrate the database gracefully or whether the internal updater would have done this and a manual update (only removing old files with new ones) could fail. I cannot test this as I have no old Roon Server instance 🤔.

@MichaIng
Copy link
Owner

Closing this in favour of #4903

@MichaIng MichaIng closed this Oct 28, 2021
MichaIng added a commit that referenced this pull request Oct 31, 2021
+ DietPi-Software | Roon Server: Resolved an issue where the internal updater purged all Roon Server data and configs, since the data directory was located within the install directory. Roon Server will now be installed to /opt/roonserver while the data directory remains at /mnt/dietpi_userdata/roonserver. This change will be applied via DietPi update as well, your data and configs will remain untouched. Many thanks to @JanKoudijs for reporting this issue and providing a solution: #4897
+ DietPi-Software | Roon Server: Merge install and config code blocks
+ DietPi-Patches | Roon Server: Instead of removing and reinstalling the old Roon Server instance, it is now moved to the new location, so that possible issues due to version changes are omitted.
+ DietPi-Software | Roon Server: Use Samba Client as dependency instead of installing cifs-utils independantly.
+ DietPi-Software | Samba/NFS Client: Do not deal with the network drive info files, as this is all done in dietpi-drive_manager. Also do not re-create it on uninstall: Not necessary when users obviously managed to set it up already. Consequently remove the default mount points on uninstall if it is empty, hence a network drive has been mounted on it already. Also add some more error handling and use failsafe unmount flags.
+ DietPi-Drive_Manager | Set Samba/NFS Client install states on mount, since all relevant install steps (package installs) are done.
+ DietPi-Software | Roon Server: Add .NET core dependency for the upcoming release, planned at November 3rd. Add Bookworm support for it and all other cases where .NET core is used and dependencies required.
+ CHANGELOG | Roon Server: Added support for the new .NET core based version, released on November 3rd, which is expected to have improved performance compared to the old Mono based version. To resolve an old issue with our Roon Server implementation (see below), a reinstall is done during the DietPi update, which pulls in the .NET core dependencies as well. But this will NOT update the Roon Server version to prevent issues with potentially required migration steps. After updating DietPi, use Roon's internal updater to benefit from the new version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants