Moving Sonarr & Radarr from Plug-In to new/blank Jail

rmccullough

Patron
Joined
May 17, 2018
Messages
269
I looked and didn't see this particular topic.

I originally created my Sonarr and Radarr jails using the plug-in. I would like to move these to a blank Jail. I am confident I can setup Sonarr and Radarr on a blank/new Jail.

However, how would I move my preferences/settings/database from the plug-in jail to the new/blank jail? Are there steps for doing this in the Sonarr/Radarr documentation? Or is there a post here on how to do that?
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
Simple answer is that you need to find the directory that contains your preferences/settings/database and move it to the new jail that you create. I have a basic jail and my data is all in /config inside the jail and I would look there first. Note that I don't use sonarr.

However, a much more robust way to do things is to keep those files in a separate dataset that you mount inside your jail. This allows you to keep the program files separated from your files so you can keep snapshots of just your data and recover either the installation or your files separately.

There's some good guides for creating a radarr jail, so I won't recreate the wheel there (and I'm still on a 2.x version). Here's some useful steps though.

1. Create a new dataset to hold your config datasets
2. Create a new dataset inside there for radarr configs
3. Mount the radarr config dataset somewhere inside your current radarr plugin (not at /config though)
4. Copy the files from /config (if it's the same place as mine) to the newly mounted dataset
5. Turn off the plugin
6. Unmount the dataset
7. Snapshot the dataset in case things go haywire
8. Create your jail for radarr
9. Create a /config directory inside the jail
10. Mount your dataset as /config inside the new jail
11. Install radarr
12. Make sure the user that radarr runs as has permissions to the config
13. If you ever have problems with your radarr install, you can just delete the jail and start at step 8, because you were smart and kept all your unique files in an external dataset!

# Step 9
iocage exec radarr mkdir -p /config

# Step 10, note that "/mnt/Vol1/jail_config_data/radarr" is where my dataset is located
iocage fstab -a radarr /mnt/Vol1/jail_config_data/radarr /config nullfs rw 0 0

# Step 12 - I run radarr as the 'media' user
iocage exec radarr chown -R media:media /usr/local/share/Radarr /config
iocage exec radarr sysrc radarr_user=media
 

rmccullough

Patron
Joined
May 17, 2018
Messages
269
It is a fair point to put my config data in a separate dataset that is mounted in the jail. I may look into that.

It looks like the plugin stores data to:
/usr/local/radarr/
/usr/local/sonarr/

But I wasn't sure how "portable" that data was.

Let me poke around. I would assume I would need to change the data dir in my rc.d scripts as well to point at the new config data set that I mount in the jail?
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
Sorry for not seeing this earlier. I'm not on the forums much these days. I think the standard jail install already points to /config, because my install directions did not include anything to point there. If I were in your shoes, create a radarr jail with the external dataset and if you mount to /config, I don't think you'll need to tell it where to go. Make sure it's running fine. If it works well enough that you can see the web interface and you verified config files are changing, then shut down the service and delete the config files. Shut down the service for your existing plugin, mount your dataset in it and copy over your config files. Then remount that dataset back in your new jail and start the service back up. It should just work. If it doesn't, then you can re-start up your plugin and it will still run on the config files in the original location.
 

rmccullough

Patron
Joined
May 17, 2018
Messages
269
I think I got this figured out. I was able to create a "config" data set that I mounted to /mnt/config. I then updated the rc.d scripts to point to that directory and updated ownership. I didn't want to mount over /config (or in my case it was /usr/local/sonarr and /usr/local/radarr), as I was worried about it having issues with permissions and such.

I had forgotten that in the plugins I had created a "media" user with GID 816 and added the sonarr/radarr users to it. I had to replicate that in these jails.

I will likely work to move more and more of my jail configs to this dataset.

What is the downside to modifying the rc.d service script? Will it get overwritten when doing a pkg update?
 

hertzsae

Contributor
Joined
Sep 23, 2014
Messages
118
The downsides to editing the rc.d script is that it could be overwritten on update. The proper way to do it is to edit the /etc/rc.conf file to overwrite the default config path, preferably through the sysrc command.

For example, I set my plex install to use /config with the following command from outside the jail:
> iocage exec plex sysrc plexmediaserver_support_path="/config"
The command within the jail would be
> sysrc plexmediaserver_support_path="/config"

Looking at my radarr rc.d file, the option to point at /mnt/config would likely be:
> iocage exec radarr sysrc radarr_data_dir="/mnt/config"
 

rmccullough

Patron
Joined
May 17, 2018
Messages
269
Thanks @hertzsae, that was the sysrc command I was looking for. Worked great.
 
Top