wiki:REDCap HowTo Install Using Docker

Version 18 (modified by saj.issa, 8 years ago) ( diff )

--

Please read Docker HowTo Install before installing REDcap

Docker HowTo Install

Prerequisites if required

Step 1 - Install Git

$ sudo apt-get update

$ sudo apt-get install git

$ sudo mkdir share

$ sudo chmod 777 -R share/

Please note you will need to have an account on git.

Step 2 - Backup Redcap Database

Log on to the mysql database machine.

mysqldump --routines --skip-extended-insert --force -h localhost -u root -p redcap > $(date +\%d-\%m-\%Y-)_redcap.sql

This will create a database dump file.

Connect to my sql.

mysql -u root -p

Create a database, make sure you postfix with Redcap version number. Please stick to this naming convention.

mysql > create database redcap6168

Import the lastest database.

mysql -u root -p -h localhost redcap6168 < 19-09-2016-_redcap.sql

Step 3 - Create / Grant Mysql permissions

If a new user is needed run the following, replace necessary details

CREATE USER 'briccsext02_user'@'uhlbriccsext02.xuhl-tr.nhs.uk' IDENTIFIED BY 'password'

Grant necessary privileges to user.

GRANT USAGE ON *.* TO 'briccsext02_user'@'uhlbriccsext01.xuhl-tr.nhs.uk' IDENTIFIED BY 'password'

GRANT ALL PRIVILEGES ON redcap6168_briccsext.* TO 'briccsext02_user'@'uhlbriccsext01.xuhl-tr.nhs.uk';

GRANT ALL PRIVILEGES ON redcap6168_briccsext.* TO 'briccsext02_user'@'uhlbriccsext02.xuhl-tr.nhs.uk';

If user already exists

GRANT ALL PRIVILEGES ON redcap6168.* TO 'redcap'@'10.156.254.207';

GRANT ALL PRIVILEGES ON redcap6168.* TO 'briccsext02_user'@'uhlbriccsext02.xuhl-tr.nhs.uk';

or

GRANT ALL PRIVILEGES ON redcap6168_briccsext.* TO 'briccsext_user'@'uhlbriccsext01.xuhl-tr.nhs.uk';

Upgrade Redcap using Docker

Go to your home directory and checkout from git docker_redcap_upgrade

sudo git clone https://github.com/LCBRU/docker_redcap_upgrade

This will create a directory /home/<USER>/docker_redcap_upgrade

This docker script upgrades an existing redcap installation.

The first step is to zip the existing redcap installation, this could be either

  1. The directory /var/www/redcap on a virtual machine.

cd /var/www/redcap

sudo zip -r redcap_v5.7.0.zip *

Move this file into /home/<USER>/docker_redcap_upgrade

  1. The directory /var/www/redcap within a running Docker container.

Connect to existing docker container using

sudo docker exec -i -t <CONTAINERID> /bin/bash

cd /var/www/redcap

sudo zip -r redcap_v5.7.0.zip *

sudo mv redcap_v5.7.0.zip /share/

exit

redcap_v5.7.0.zip should now be available on the host machine. In the directory /share/

Move this file into /home/<USER>/docker_redcap_upgrade

sudo docker build -t lcbruit/redcap_fresh:v6.16.6 .

sudo docker run -v /share:/share -itd -p 80:80 lcbruit/redcap_fresh:v6.16.6

sudo docker exec -i -t cbd3b580bd1b /bin/bash

There are 3 docker scripts available from github :

git clone https://github.com/LCBRU/docker_redcap_upgrade

Amend database.php

sudo docker build -t lcbruit/redcap_fresh:v6.16.6 .

sudo docker run -itd -p 80:80 lcbruit/redcap_fresh:v6.16.6

git clone https://github.com/LCBRU/docker_redcap_v5.7.0

git clone https://github.com/LCBRU/docker_redcap_fresh

REDCap 6.16.6

http://uhlbriccsapp02.xuhl-tr.nhs.uk/redcap/index.php

REDCap Software - Version 5.7.0

http://uhlbriccsapp02.xuhl-tr.nhs.uk:81/redcap/index.php

Installation script

  • Image
  • CRON
  • php upgrade
Note: See TracWiki for help on using the wiki.