DBSetup - peteschaefer/jose GitHub Wiki

Database Setup

By default, jose stores game data in the directory jose/database/mysql/jose. To prevent data loss, we recommend making regular backups of that directory. Restoring the backup is just a matter of unpacking data files.

Alternatively, you can set up a real database server on your local network, or in the cloud. This allows you to access your game data from anywhere, or to share it with other people.

Here's how you do it:

In your Local Network

  • Download server software from https://www.mysql.com/downloads
    • Version 8.4 should be a good choice, I suppose.
    • but jose supports older versions, too (the bundled version is, actually, very, very old :)
  • MariaDB seems to work reliably, too: https://mariadb.com/downloads/
  • for installing and running a MySQL server, refer to their instructions
    • you might need some admin privileges for setting up network and firewall stuff
  • use a MySQL client tool (mysqladmin) to create a new, empty database for jose:
    create database jose
    • don't create any tables, yet
  • instruct jose to make use of the server: edit the file jose/config/datasources.xml
    • look for an entry that starts with <display-name> MySQL-external</display-name>
    • you are free to add more configuration entries; just take care to stick to the xml syntax
    • the important piece of information is <jdbc-url>
    • edit the url such that it points to the server host, e.g. jdbc:mysql://192.168.0.501:3306/jose
    • :3306 refers to the port number the server is listening to
    • /jose is the name of the database schema we created above
    • edit user and password below
  • a data source for MariaDB is available. Works just like the one above.
  • now, restart jose with jose -db MySQL-external
    • jose should connect to the server, and..
    • ..create a fresh set of tables
  • alternatively, set the attribute <data-source default="true"> to use that server by default
  • switching between databases is simply done by passing the right name on the command line
    • if this feature becomes popular I should add gui support

In the Cloud

  • there's a number of cheap, even free, MySQL hosting providers. AWS shold be the most reliable (you guessed it).
  • refer to your cloud provider's instructions for setting up a MySQL database server
  • then create an empty database schema
  • remember to make port 3306 accessible from outside (for AWS, see Security Groups)
  • follow the instructions above. Configuration setup is similar to the local case.
  • the connection URL might look somethink like this:
    jdbc:mysql://database-1.xyzabcdef.eu-central-1.rds.amazonaws.com:3306/jose

Limitations

  • expect response times to be slower over the network; browsing through a million games database might not work so well (it does with a local installation). Use search terms to narrow down result sets.
  • importing and exporting archive files (*.jose) is not possible. Use *.pgn files, or zipped pgn files, instead.
  • Help / Database Repair is not available for external databases

Problems ?

⚠️ **GitHub.com Fallback** ⚠️