| 21 | == Upgrade CiviCRM using Docker |
| 22 | |
| 23 | Step 1. On the host machine go to directory |
| 24 | |
| 25 | {{{/local/docker/<USER>/}}} |
| 26 | |
| 27 | Step 2. Go to this directory and checkout from git docker_civicrm_upgrade |
| 28 | |
| 29 | {{{sudo git clone https://github.com/LCBRU/docker_civicrm_upgrade.git}}} |
| 30 | |
| 31 | {{{sudo chmod -R 777 docker_civicrm_upgrade/}}} |
| 32 | |
| 33 | This will create a directory /local/docker/<USER>/docker_civicrm_upgrade |
| 34 | |
| 35 | This docker script upgrades an existing CiviCRM installation. |
| 36 | |
| 37 | Step 3. The main configuration file is Dockerfile |
| 38 | |
| 39 | Modify the following lines in Dockerfile : |
| 40 | |
| 41 | {{{ENV DRUPALVERSION 7.53}}} |
| 42 | |
| 43 | {{{ENV CIVICRMVERSION 4.7.15}}} |
| 44 | |
| 45 | {{{#####################}}} |
| 46 | |
| 47 | {{{# select only one}}} |
| 48 | |
| 49 | {{{ENV ENVIRONMENT test }}} |
| 50 | |
| 51 | {{{#ENV ENVIRONMENT live}}} |
| 52 | |
| 53 | {{{#####################}}} |
| 54 | |
| 55 | Note the database config are in the live and test folders. |
| 56 | |
| 57 | Modify as necessary the files : |
| 58 | |
| 59 | {{{civicrm.settings.php}}} |
| 60 | |
| 61 | {{{settings.php}}} |
| 62 | |
| 63 | Step 4. Build Docker container |
| 64 | |
| 65 | {{{sudo docker build -t lcbruit/civicrm:v4.7.15 .}}} |
| 66 | |
| 67 | {{{sudo docker build --no-cache=true -t lcbruit/civicrm:v4.7.15 .}}} |
| 68 | |
| 69 | Ensure that the **version number** matches the actual CiviCRM version you are upgrading to. |
| 70 | |
| 71 | Run container |
| 72 | |
| 73 | {{{sudo docker run -v /share:/share -itd -p 80:80 lcbruit/civicrm:v4.7.15}}} |
| 74 | |
| 75 | To connect to container : |
| 76 | |
| 77 | {{{sudo docker ps -a}}} |
| 78 | {{{sudo docker exec -i -t [CONTAINER ID] /bin/bash}}} |
| 79 | |
| 80 | Step 5. Upgrade Drupal and CiviCRM |
| 81 | |
| 82 | To upgrade Drupal point your browser to : |
| 83 | |
| 84 | {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/update.php?op=info}}} |
| 85 | |
| 86 | To upgrade CiviCRM point your browser to : |
| 87 | |
| 88 | {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/upgrade?reset=1}}} |
| 89 | |
| 90 | Go to Drupal -> Modules and enable the module 'Module Missing Message Fixer' |
| 91 | |
| 92 | Go to Drupal -> Configuration -> Missing Module Message Fixer to remove any missing modules. |
| 93 | |
| 94 | Go to the url : |
| 95 | |
| 96 | {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/path?reset=1}}} |
| 97 | |
| 98 | ensure that the following are set to : |
| 99 | |
| 100 | {{{Temporary Files Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/upload/}}} |
| 101 | |
| 102 | {{{Image Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/persist/contribute/}}} |
| 103 | |
| 104 | {{{Custom Files Directory = /var/local/civicrm/drupal/sites/default/files/civicrm/custom/}}} |
| 105 | |
| 106 | {{{Custom Template Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_templates/}}} |
| 107 | |
| 108 | {{{Custom PHP Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_php/}}} |
| 109 | |
| 110 | {{{Extensions Directory = /var/local/civicrm/drupal/sites/all/lcbru_custom/civicrm_extensions/}}} |
| 111 | |
| 112 | Go to the url : |
| 113 | |
| 114 | {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/url?reset=1}}} |
| 115 | |
| 116 | ensure that the following are set to : |
| 117 | |
| 118 | {{{CiviCRM Resource URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/all/modules/civicrm}}} |
| 119 | |
| 120 | {{{Image Upload URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/default/files/civicrm/persist/contribute/}}} |
| 121 | |
| 122 | {{{Extension Resource URL = http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/sites/all/civicrm_extensions}}} |
| 123 | |
| 124 | Go to the url : |
| 125 | |
| 126 | {{{http://XXXXXXXXXXXXXX.xuhl-tr.nhs.uk/civicrm/admin/setting/misc?reset=1}}} |
| 127 | |
| 128 | ensure that the following are set to : |
| 129 | |
| 130 | {{{Path to wkhtmltopdf executable = /usr/local/bin/wkhtmltopdf}}} |
| 131 | |
| 132 | Go to the url : |
| 133 | |
| 134 | {{{http://uhlbriccsapp07.xuhl-tr.nhs.uk/civicrm/admin/extensions?reset=1}}} |
| 135 | |
| 136 | Remove any extensions not required. |
| 137 | |
| 138 | Stop the container : |
| 139 | |
| 140 | {{{sudo docker ps -a}}} |
| 141 | {{{sudo docker stop [CONTAINER ID] }}} |
| 142 | |
| 143 | Step 6. Set location of theme directory. |
| 144 | |
| 145 | Connect to your drupal database and run the following |
| 146 | |
| 147 | {{{select * from variable where name = 'color_antonelli_files'; }}} |
| 148 | |
| 149 | This give the following output |
| 150 | |
| 151 | {{{a:2:{i:0;s:42:"public://color/antonelli-d1bee6f5/logo.png";i:1;s:44:"public://color/antonelli-d1bee6f5/colors.css";} }}} |
| 152 | |
| 153 | Modify the Dockerfile as follows |
| 154 | |
| 155 | {{{################### }}} |
| 156 | |
| 157 | {{{#css location. first line is test, 2nd line is live }}} |
| 158 | |
| 159 | {{{ENV CSS antonelli-d1bee6f5/ }}} |
| 160 | |
| 161 | {{{#ENV CSS antonelli-75b84edd }}} |
| 162 | |
| 163 | {{{#################### }}} |
| 164 | |
| 165 | Rebuild you image : |
| 166 | |
| 167 | {{{sudo docker build -t lcbruit/civicrm:v4.7.15 .}}} |
| 168 | |
| 169 | {{{sudo docker build --no-cache=true -t lcbruit/civicrm:v4.7.15 .}}} |
| 170 | |
| 171 | Run container |
| 172 | |
| 173 | {{{sudo docker run -v /share:/share -itd -p 80:80 lcbruit/civicrm:v4.7.15}}} |
| 174 | |
| 175 | Step 7. Ensure you have set the container to start on reboot. |
| 176 | |
| 177 | [[Docker HowTo Auto Start Containers On Reboot]] |
| 178 | |