Using an External Database
By default, Subsonic uses an in-process HSQLDB database which requires no setup or maintenance. Starting with Subsonic 6.1, advanced users have the option to use an external database instead. The following databases are supported:
- MySQL (tested with version 5.6 and 5.7)
- PostgreSQL (tested with version 9.6)
- MariaDB (tested with version 10.1)
Setup
- Make sure you are using Java 8.
- Install MySQL/PostgreSQL/MariaDB, or use an existing database server.
- Create an empty database called "subsonic".
- Set the JDBC URL of the database as a start-up option to Subsonic (see below).
JDBC URL
MySQL / MariaDB | jdbc:mysql://localhost:3306/subsonic?user=root&password=mysecretpassword&characterEncoding=UTF-8 |
PostgreSQL | jdbc:postgresql://localhost:5432/subsonic?user=postgres&password=mysecretpassword |
Remember to change hostname, port, user and password according to your installation.
Start-up option
The JDBC URL must be given as a start-up option. This is done differently depending on how you installed Subsonic.
Windows | Add -Dsubsonic.db=<JDBC URL> in C:\Program Files (x86)\Subsonic\subsonic-service.exe.vmoptions |
Mac | Add -Dsubsonic.db=<JDBC URL> in /Applications/Subsonic.app/Contents/Info.plist |
Linux | Add --db=<JDBC URL> to SUBSONIC_ARGS in
/etc/default/subsonic (Ubuntu/Debian) or /etc/sysconfig/subsonic (Fedora/RPM). |
Migration
Please note that there is no automatic data migration from HSQLDB to MySQL/PostgreSQL/MariaDB.