This document will go over the key points of migrating and setting up Postgres support in Radarr.
This guide was been created by the amazing Roxedus.
First, we need a Postgres instance. This guide is written for usage of the
postgres:14 Docker image.
Do not even think about using the
docker create --name=postgres14 \ -e POSTGRES_PASSWORD=qstick \ -e POSTGRES_USER=qstick \ -e POSTGRES_DB=radarr-main \ -p 5432:5432/tcp \ -v ..appdata/postgres14:/var/lib/postgresql/data \ postgres:14
Radarr needs two databases:
radarr-mainThis is used to store all configuration and history
radarr-logThis is used to store events that produce a logentry
Create these databases using your favorite method, with the same username and password. Roxedus used Adminer, as he already had that set up.
We need to tell Radarr to use Postgres. The
config.xml should already be populated with the entries we need:
<PostgresUser>qstick</PostgresUser> <PostgresPassword>qstick</PostgresPassword> <PostgresPort>5432</PostgresPort> <PostgresHost>postgres14</PostgresHost>
If you do not want to migrate a existing SQLite database to Postgres, you are already finished with this guide!
To migrate data we can use PGLoader. It does, however, have some gotchas:
--with "quote identifiers"to make them sensitive.
With these handled, it is pretty straightforward after telling it to not mess with the scheme using
--with "data only":
pgloader --with "quote identifiers" --with "data only" radarr.db 'postgresql://qstick:qstick@localhost/radarr-main'
Or alternatively, using the Docker image producing the binary:
docker run -v ..radarr.db:/radarr.db --network=host ghcr.io/roxedus/pgloader --with "quote identifiers" --with "data only" /radarr.db "postgresql://qstick:qstick@localhost/radarr-main"