updates
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| updates [2017/04/14 12:05] – admin | updates [2026/03/21 10:12] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| + | |||
| + | Updates help us and you keep your copy up-to-date. With updates, new features and other improvements are added to the script. Within a single update there can be different builds with minor fixes. The update and build number is written at the end of each page. | ||
| - | Updates help us and you to keep your copy in actual state. Updates contists of some changes to DB and files reflecting new features in script. | ||
| - | To appaly an update to your script just click on Home at the top of you admin are and select an update. Make sure you apply updates step by step, do not skip updates. At the same page you can see your current version. | ||
| ====== How to run update ====== | ====== How to run update ====== | ||
| + | |||
| + | Click Maintenance - Update in the admin panel or run in the shell | ||
| < | < | ||
| cd your_path_to/ | cd your_path_to/ | ||
| - | php update.php | + | php update.php |
| </ | </ | ||
| + | |||
| + | and the script will be updated to the current version | ||
| ====== TCMS (Smartcj 2.X) Updates ====== | ====== TCMS (Smartcj 2.X) Updates ====== | ||
| Line 18: | Line 22: | ||
| ====== SmartCJ v 1.X Updates ====== | ====== 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 | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| Line 70: | Line 92: | ||
| [[Update 28]] | [[Update 28]] | ||
| + | * Base command to run all updates. It will update your script to the latest version | ||
| + | < | ||
| + | cd / | ||
| + | </ | ||
| - | ====== Multidomain Update ====== | ||
| - | You can create a file with all your domains | + | ===== How to run a specific update ===== |
| + | |||
| + | |||
| + | < | ||
| + | cd / | ||
| + | for example | ||
| + | cd / | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | update.php source code | ||
| + | |||
| + | < | ||
| + | |||
| + | <?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 / | ||
| + | cd / | ||
| + | |||
| + | and so on for as many lines as needed. And run it from the shell | ||
| - | cd / | ||
| - | cd / | ||
| - | | ||
| - | and so on and run it in SSH | ||
| - | | ||
| 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.1492171503.txt.gz · Last modified: (external edit)
