Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Updating libretime's database from 9.x to 10.x

guillaume edited this page Jan 19, 2020 · 1 revision

It is possible that you were running libretime using an older version of postgres. If your cluster is in version 9.x (run pg_lsclusters to check version), it is possible to import your data to libretime-docker which uses postgres version 10 (default on Ubuntu 18.04).

Saving your data

Your first action will be to save (dump) all your 9.x data in a file:

  1. su - postgres

  2. pg_dump airtime -f backup.dump

The file backup.dump will contain everything you need to reinstate your database with all the needed information.

Transferring it the libretime-docker container

Once your file in on the host machine (and in the current dir), start a libretime-docker container (go through the installation steps if need) and run docker cp backup.dump libretime:/var/lib/postgresql/backup.dump afterwards. This assumes that the container's name is libretime.

Updating the database

At this point, you have your backup.dump file ready. What you want to do is:

  1. docker exec -it libretime bash to get inside the container

  2. su - postgres to login as postgres

  3. dropdb airtime self-explanatory

  4. createdb airtime recreate empty airtime db

  5. pg_restore -d airtime backup.dump to restore your database

At this point you should be able to refresh your airtime web tab and see everything has been imported.