15
edits
Tag: 2017 source edit |
(Command line upgrade: one pass per major version, upgrade.unlock trap (tested from 22 to 24)) |
||
| Line 356: | Line 356: | ||
$ php step5.php oldx.oldy.oldz x.y.z > output3.html | $ php step5.php oldx.oldy.oldz x.y.z > output3.html | ||
</source> Note: z must be "0" because only major versions have a migration script to run. Return code will be 0 if success, 1 if error (if this happens, see file output.html, output2.html or output3.html). | </source> Note: z must be "0" because only major versions have a migration script to run. Return code will be 0 if success, 1 if error (if this happens, see file output.html, output2.html or output3.html). | ||
'''Several major versions apart''' (checked from 22 to 24): run the 3 commands once per major version, in order (22.0.0 → 23.0.0, then 23.0.0 → 24.0.0). A single 22.0.0 → 24.0.0 call does run the SQL files, but it skips the data migrations of the intermediate version, without any error. | |||
In 22, 23 and 24 (tested), if the documents directory contains install.lock, first create an empty upgrade.unlock file in the same place. For each intermediate step, end step5.php with <code>auto upgrade_</code> followed by the target version: otherwise step5.php deletes upgrade.unlock after the 1st step, and the next step is refused with return code 0, so nothing tells you. | |||
<source lang="bash"> | |||
$ touch /path/to/documents/upgrade.unlock | |||
$ php upgrade.php 22.0.0 23.0.0 > step1.html | |||
$ php upgrade2.php 22.0.0 23.0.0 >> step1.html | |||
$ php step5.php 22.0.0 23.0.0 auto upgrade_23.0.0 >> step1.html | |||
$ php upgrade.php 23.0.0 24.0.0 > step2.html | |||
$ php upgrade2.php 23.0.0 24.0.0 >> step2.html | |||
$ php step5.php 23.0.0 24.0.0 >> step2.html | |||
$ rm /path/to/documents/upgrade.unlock | |||
</source> | |||
Test details and a complete script with backup: https://dolix.fr/en/notes/dolibarr-script-mise-a-jour/ | |||
=Related videos= | =Related videos= | ||
edits