updates
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| updates [2014/01/29 18:05] – external edit 127.0.0.1 | updates [2026/03/21 10:12] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| - | Updates help us and you to keep your copy in actual state. Updates contists of some changes to DB and files reflecting | + | Updates help us and you keep your copy up-to-date. With updates, |
| - | To appaly an update | + | |
| - | ====== How to do update ====== | + | ====== How to run update ====== |
| - | - Click ' | + | Click Maintenance |
| - | | + | |
| - | - Scroll down and check if you have any new updates | + | |
| - | - Click on a link (link like Update | + | |
| - | - Follow instructions (usually | + | |
| + | < | ||
| + | cd your_path_to/ | ||
| + | php update.php | ||
| + | </ | ||
| + | and the script will be updated to the current version | ||
| + | |||
| + | ====== TCMS (Smartcj 2.X) Updates ====== | ||
| + | |||
| + | |||
| + | [[ru: | ||
| + | |||
| + | |||
| + | ====== SmartCJ v 1.X Updates ====== | ||
| + | |||
| + | |||
| + | In version 1 each update had to be installed sequentially | ||
| + | |||
| + | < | ||
| + | cd your_path_to/ | ||
| + | php update.php update_number | ||
| + | |||
| + | |||
| + | for example if you are on 49 and need to reach 52 | ||
| + | |||
| + | php update.php 50 | ||
| + | php update.php 51 | ||
| + | php update.php 52 | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | [[Update 52]] | ||
| + | |||
| + | [[Update 51]] | ||
| + | |||
| + | [[Update 50]] | ||
| + | |||
| + | [[Update 49]] | ||
| [[Update 48]] | [[Update 48]] | ||
| Line 57: | Line 92: | ||
| [[Update 28]] | [[Update 28]] | ||
| + | * Base command to run all updates. It will update your script to the latest version | ||
| + | < | ||
| + | cd / | ||
| + | </ | ||
| - | * run following commands in SSH | ||
| - | cd / | + | ===== How to run a specific |
| - | env HTTP_HOST=yourdomain.com php update.php | + | |
| - | ====== Multidomain Update ====== | + | < |
| + | cd / | ||
| + | for example | ||
| + | cd / | ||
| + | </ | ||
| - | You can create a file with all your domains | ||
| - | | + | |
| - | cd / | + | update.php source code |
| - | + | ||
| - | and so on and run it in SSH | + | < |
| - | + | ||
| + | <?php | ||
| + | require(' | ||
| + | require(' | ||
| + | |||
| + | // out of space fix | ||
| + | $df = disk_free_space(" | ||
| + | if ($df < 5*1024*1024) { | ||
| + | die(" | ||
| + | } | ||
| + | |||
| + | // slow connection fix | ||
| + | $mysql_version = db_value(' | ||
| + | if (stristr($d[' | ||
| + | db_query(" | ||
| + | } | ||
| + | |||
| + | if ($argv[1] != '' | ||
| + | $num = (int) $argv[1]; | ||
| + | if ($num > 0) { | ||
| + | ProcessUpdate($num); | ||
| + | exit; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | $tmp = get_url(" | ||
| + | if ($tmp[' | ||
| + | die(" | ||
| + | } | ||
| + | |||
| + | $last_script_version = $tmp[' | ||
| + | |||
| + | if ($last_script_version == $settings[' | ||
| + | |||
| + | while ($settings[' | ||
| + | echo " | ||
| + | if (ProcessUpdate($settings[' | ||
| + | $settings[' | ||
| + | } | ||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | function ProcessUpdate($update_id) { | ||
| + | global $settings; | ||
| + | |||
| + | $tmp = get_url(" | ||
| + | if ($tmp[' | ||
| + | echo " | ||
| + | return false; | ||
| + | } | ||
| + | $_REQUEST[' | ||
| + | ob_start(); | ||
| + | eval ('?>' | ||
| + | $res = ob_get_clean(); | ||
| + | $res = str_replace('< | ||
| + | echo strip_tags($res); | ||
| + | |||
| + | return true; | ||
| + | |||
| + | } | ||
| + | |||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ====== How to update all domains at once ====== | ||
| + | |||
| + | You can create a file, for example update.sh, which contains lines like this: | ||
| + | |||
| + | | ||
| + | cd / | ||
| + | |||
| + | and so on for as many lines as needed. And run it from the shell | ||
| sh update.sh | sh update.sh | ||
| - | | ||
| - | This way you can update all domains at once. | ||
| - | Note: update script | + | During installation and update, the script |
| - | - add to update.sh something | + | - add lines like cp ../ |
| - | - or create | + | - or at installation time, do not copy the index, but make a symlink to the corresponding directory. |
| + | |||
| + | ====== How to rollback an update ====== | ||
| + | |||
| + | The only way is if you have a backup from the version you need. | ||
| + | |||
| + | You need to install the script of that version and upload the backup of the MySQL database from the same version. | ||
| + | |||
| + | You cannot just upload a backup of MySQL from version 44 to version 45 script for example. | ||
| + | |||
| + | |||
| + | ====== How to update a site with a very large database ====== | ||
| + | |||
| + | Update can be a fairly heavy procedure for the server, and some pages may be incorrectly cached, etc. Some services, for example in case of a major update release, usually do this at night and close the site, showing a standard message that the service will be available in a few hours. But if you don't want to interrupt operations, you can do it as follows. To do this you need to | ||
| + | |||
| + | - Install the script on another (sub)domain, | ||
| + | - Upload the database from the main domain there | ||
| + | - Run the update on this separate subdomain | ||
| + | - All heavy database procedures will run there, while the main site remains unaffected | ||
| + | - Transfer the database from the auxiliary domain to the main one | ||
| + | - Perform the update on the main - it will go quickly as the database is already changed, you only need to download the files. | ||
| - | ====== Update rollback ====== | ||
| - | There' | ||
updates.1391018744.txt.gz · Last modified: by 127.0.0.1
