Using Git to sync/update OpenLP, particularly the song database, between multiple computers/people

We have a number of people in our church involved in services each week — music leaders, musicians, pastor, projector operators — who need to use OpenLP, and who need to make sure that they are all working with the same version of the song database, images and so forth. To make sure that the song database is correct and consistent we don't have everyone making changes, there is one person responsible for editing songs.

To keep this under control, yet have an easy and transparent way to then get updates out to all persons we looked at and tried Dropbox (have to pay for read-only shared access) and Google Drive (messes up the write permissions on the SQLite DB which makes OpenLP crash). The other problem with both of these services, particularly if you host the song database in 'the cloud', is they have no concurrency (multi-user) functionality to allow multiple working on files.

The method I used in the end is a Git repository. I made a Git server (on a FreeBSD virtual machine), one could also use a free account at Github if you didn't mind your OpenLP setup/data being completely open to the Internet.

With a script now I have Windows, Mac & Linux users pulling down updates from the Git server so they are all fully in-step with edits to the song database. As some of the OpenLP folders & files are specific to users/machines we have a selective replication of folders/files in our Git setup.

As I mentioned our setup is now working, just curious if anyone else has done something similar?


Comments

  • We use DropBox to keep our song database and service files synchronised between about 4 or 5 team members in our projection team. We certainly don't have to pay for the 2Gb free version which is enough space for us.

    We do occasionally get 'conflicted copies' of the song database if two people happen to update at the same time, but this is rare and fairly easy to spot and resolve.

    DropBox allows us to share the 'data' folder containing the song database without problems, but we also have a shared folder for service files so one person can prepare and another can use it to present. Dropbox also keeps event history so you can see who has updated recently.
  • Hi - Git is essentially doing the same albeit with a bit more structure and management. Dropbox would have been my second choice. I did also try Google Drive using read-only option (which the free version of Dropbox doesn't have) but found it wasn't controlling write access via the 'cloud' drive on the server but marking files as read-only which caused OpenLP to crash when it was accessing the song database (obviously.
  • edited February 13
    Excellent idea i.e. using a git repo,  FromOZ, don't know why I didn't think of that before :). Any chance you can comment on how it's been working for you? 
  • edited February 13
    Hi @rowanpi - it's working fine, we've been using for almost two years now. There is a little bit of setup but once it's in place it's just running a script I wrote (I've attached for you).

    The user computer (Linux/Unix/MacOS/Windows) needs to have Git installed, for Windows can be installed easily. The script runs inside the Git Bash shell on Windows.

    I've attached a ZIP file which has:
    1. SyncOpenLP - bash shell *nix script file
    2. SyncOpenLPWin.sh - bash shell script for Windows. Needs to run in bash shell installed with Git for Windows.
    3. SYSTEM.gitignore - goes in OpenLP 'system' folder location which is listed in the two scripts
    4. USER.gitignore - goes in the OpenLP 'user data' folder location which is listed in the two scripts
    Obviously for the two XXX.gitignore files you take off the 'SYSTEM' or 'USER' prefix to be left with '.gitignore'.

    Here is the process basically.
    1. Setup OpenLP on the reference or master computer - ours is a Mac. We use the standard 'system' location where OpenLP installs (on a Mac $HOME/Library/Application Support/openlp) plus we setup a user 'data' folder under Documents which has the following folders - Config, Images, Media, Services, Slides. The 'Images' folder is the only one which gets synced via Git. We use the images folder for our shared service pictures shown on the projector. All the others have information which is specific to each person.
    2. Put all your songs into OpenLP. We also have standard themes I have created for our church - these also get copied via Git to all users (see .gitignore file).
    3. Make a git repository - for the system folder and the user data folder if you use that.
    4. Put the relevant .gitignore files into the respective Git repos
    5. Do the initial commit (make sure .gitignore is there first so only desired folders/files go into repo)
    6. You need to then push the repos to a server (I run my own)
    7. Then go to user machine and install new copy of OpenLP.
    8. After install temporarily move the OpenLP system 'Data' folder somewhere else.
    9. Do a manual clone of the repo into the 'openlp' folder - this will pull down from the server the relevant files/folders.
    10. Then manually copy back the non git synced files/folders from the original install folder you temp. renamed.
    What you will end up with is an OpenLP system folder setup where the folders /bibles, /songs & /themes are synced from the master computer.

    If you want to have a user data folder - in the user's Documents folder (see script) then do similar steps.

    Then put the two syncing scripts in a location where the user can just double click them (I put on the desktop for them) and it will all just synch. Note that in the scripts I use Git stash feature to throw away any mistaken local changes that they may have made to the song database etc. because obviously there is only one 'master'.

    Have a look at the scripts and see how you go. It's a little bit daunting (depending on your experience with Git) but once setup it's just a click and run task for users. Has worked flawlessly for us with multiple users.

    =================
    I've tried attaching a ZIP file twice, I don't see it attached to the post. Do you see it?? Don't know if there's some bug with the forum software?
Sign In or Register to comment.