... {note}CLI Installation is available only for MODX Revolution versions 2.2 and later.{note} {toc} h2. Installing MODX via the PHP Command Line MODX allows you to do upgrades and installations via the command line (CLI) while using a config XML file. (More info on this file can be found [here|The Setup Config Xml File].) This allows users to create simple batch scripts to update their MODX installations. {warning}When running upgrades, it is *always* recommended to backup your files before upgrading.{warning} h2. New CLI Installations First off, [download MODX|http://modx.com/download/] and extract the files to your server. In the setup/ directory, copy the file "config.dist.new.xml" and rename it to "config.xml". MODX will automatically look for the setup/config.xml file during installation. You can move it outside of the setup/ directory (and the MODX webroot, if you choose), and specify its location with the "--config=/path/to/config.xml" argument. Next, edit the XML file and set the appropriate database information, MODX paths, and other configuration parameters, and then in your command line prompt, browse to the MODX setup/ directory, and type: {code} php ./index.php --installmode=new {code}
|
... Follow the same steps as new installations, but this time in your XML file you need only specify the following attributes: * inplace * unpacked * language * remove_setup_directory And any other attributes you would like to change during the upgrade. There is an example upgrade xml file named "config.dist.upgrade.xml". Then, once you are ready, browse to the MODX setup directory, and type: {code} php ./index.php --installmode=upgrade {code} This will upgrade your MODX installation, and when finished will display the time it took to run the installation, as well as any errors that occurred (which will also be logged in an install log file in core/cache/logs/). h2. Doing an Advanced Upgrade MODX via CLI Follow the same steps as basic upgrade, but this time in your XML file you need all the attributes included in the config.dist.upgrade-advanced.xml file, as all can be changed in an advanced upgrade. Then, once you are ready, browse to the MODX setup directory, and type: {code} php ./index.php --installmode=upgrade-advanced {code} This will upgrade your MODX installation, and when finished will display the time it took to run the installation, as well as any errors that occurred (which will also be logged in an install log file in core/cache/logs/). h2. See Also {pagetree:root=Installation}
|