Loading...
 
Skip to main content



升级您的 Tiki 站点

升级 Tiki 与其 installation 非常相似。升级是一个 单向过程。虽然您可以通过 Backup 恢复到先前版本,但无法降级。在进行重大升级(例如从 21.x 升级到 23.x)之前,请先在一个非生产站点上进行测试升级,然后再执行正式升级。

我需要升级吗?
建议您始终升级当前发行版的小版本(例如从 22.0 到 22.1),以 消除安全漏洞。某些 Tiki 版本被列为 dev:Version Lifecycle,这意味着开发者会在较长一段时间内继续为该版本提供安全补丁和错误修复。小版本升级不太可能引起问题。

重大升级会引入新功能,但现有功能、主题、插件和模块可能无法像以前一样工作。强烈建议进行测试升级。

概述:升级的工作原理
  1. Backup 当前安装的所有文件和数据库。

  2. 解压新版本,最好解压到一个空文件夹中。

  3. 从备份中复制任何自定义文件 (css、上传的文件和图片、自定义模板) 。

  4. 运行安装程序 (tiki-install.php) ,它将升级数据库。


我真的需要下载然后通过 FTP 上传整个包吗? —— 对于某些升级,如果只修改了少量文件,会提供“补丁版本”。另外,也有一些(tw:1-click installers|自动化脚本)可以帮您处理升级过程。

FTP 之外的其他选择: 与其下载并重新上传整个包,不如使用 svnwget 命令(请咨询您的主机提供商)将文件直接从 SourceForge 传输到您的服务器。

1.1. 关于自定义主题

停用自定义主题: 来自旧版本的自定义主题和自定义 .tpl 文件很可能无法工作,并可能导致升级失败。在新安装中,通过更改活动 CSS 文件的名称来停用自定义主题,这样 Tiki 将找不到该文件,从而恢复为默认主题。

1.2. 确定您要升级到哪个版本

请记住,Tiki21Tiki24 是长期支持(LTS)版本,升级到该分支的最新版本始终更安全。如果您运行的是大量使用许多功能的生产站点,使用 x.1 版本中的当前稳定分支(例如 21.1 而不是 21.0)也始终更安全。

1.3. 通过全新安装升级还是在现有基础上安装?

全新安装(推荐)

您需要手动移动和/或重新集成未存储在 MySQL 数据库中的任何数据,例如保存为文件的图片和附件。这是推荐的过程,特别是如果您有自定义主题样式,或者有一个新 Tiki 版本不支持的样式。

在现有基础上安装(不推荐用于重大更新)

这不会删除先前版本使用但不再需要的任何 Tiki 文件。这些文件除了浪费一些磁盘空间外不应做任何事情,但模板文件(./templates 或其子文件夹下的 .tpl 文件)除外。您可以使用 Security Admin 来检测残留的 PHP 文件。

不推荐这样做,因为您保留了以前 Tiki 版本的所有文件,其中可能包含过时的 tpl 文件,这些文件可能与新版本冲突,尤其是在主题样式已更改或不再受新 Tiki 版本支持的情况下。因此,避免任何潜在冲突的最佳选择是在新目录中安装新的 Tiki,然后用新版本替换旧版本,并重新插入您需要的自定义文件(img/wiki_up、修改后的 tpl 文件,前提是您确认它们已更新到新的 Tiki 版本等)。请参见下面的“全新安装”。

如果是小版本发布(21.1 到 21.2),则不太可能引起任何问题,因为模板变化不大,只有错误修复。

1.4. 创建备份

您需要备份:

  1. 安装 Tiki 的整个文件夹(以及所有子文件夹)
  2. 您的 MySQL 数据库

详情请参见:Backup

1.5. 更新您的文件

Tiki 文件以压缩包(例如 .zip)形式分发。您需要解压(unzip)文件并将其上传到您的 Web 服务器。

全新安装

您可以进行全新安装,而不是覆盖旧文件。

您可能需要从旧站点复制到新站点的内容:

  • img/wiki_up 文件夹内容(上传的 wiki 图片)
  • img/trackers 文件夹内容(上传到跟踪器项的图片)
  • 任何自定义的 *.tpl 文件
  • 任何自定义样式( *.css
  • 如果使用文件系统存储文件,则任何文件库目录
  • 如果使用文件系统保存图片,则任何图片库目录
  • 任何自定义代码
    • 如果您所做的更改对他人也有用,请考虑加入 Tiki 社区并分享您的增强功能。除了帮助他人之外,您将不再需要在每次升级时重新恢复和维护您的增强功能。请参见 dev:How to get commit access。(:biggrin:)


数据库排序规则

如果您升级但使用的是新服务器,因此需要先创建新数据库,请确保使用 utf8mb4 排序规则 创建新数据库。

  • 注意:默认情况下,Tiki 对数据库编码使用 UTF-8(mb4)。我们强烈建议您在 phpmyadmin(或类似工具)的“collation”下拉框中,在如下图所示的字段中选择“utf8”:
    Image

在现有基础上安装

要升级,请将新版本的所有文件复制或上传到旧版本的文件上,以便替换所有较旧的文件(FTP 使用“如果源文件较新则覆盖”)。

在覆盖文件之前,请删除非自定义的样式特定模板(templates/styles/*,以及 templates/yoursite/*(如果有))。早期版本通常包含针对每种样式的修改。这些文件已从标准发行版中移除,使旧文件保持完整,且无法利用增强功能。

通过 Git 或 SVN 更新

如果您使用 Git 或 SVN 安装,则可以轻松地通过它们进行更新。请参见 dev:Get Code

1.6. 检查权限

1.6.1. File and Folder permissions

If your server is unhappy with Tiki file and folder permissions (this is dependent on server configuration), you may get an error message or blank pages. These failed attempts are typically in the error log (ask your web host to know where they are as it's different depending of your setup)

Too few permissions
If a message appears indicating that specific directories are not writable, you will need to change the permissions on the indicated directories. Tiki will attempt to verify that it can read (and write) to all necessary directories. This error message will include instructions about how to resolve the issue.

Too many permissions
If you are getting Internal Server Error 500, blank pages or similar, it could be that the permissions on the files are not appropriate for your webhost.

If your permissions are currently at "777", use your FTP client to change the files to "755". If Tiki is installed in a directory, make sure to also change the permission of the folder which contains the tiki files.

If you have shell access, you can run:

Copy to clipboard
sh setup.sh

and answer any questions. If you don't know what to answer, just click "enter" to keep the defaults.

Copy to clipboard
root@yourserver:/var/www/tiki# sh setup.sh Tiki setup.sh - your options ============================ Composer: If you are installing via a released Tiki package (zip, tar.gz, tar.bz2, 7z), you can and should skip using Composer. If you are installing and upgrading via SVN, you need to run Composer after 'svn checkout' and 'svn upgrade'. More info at https://dev.tiki.org/Composer c run composer and exit (recommended to be done first) For all Tiki instances (via SVN or via a released package): f fix file & directory permissions (classic default) o open file and directory permissions (classic option) S clear screen predefined Tiki Permission Check models: ---------------------------------------- 1 paranoia 2 paranoia-suphp w suphp workaround 3 sbox W sbox workaround 4 mixed 5 worry 6 moreworry 7 pain 8 morepain 9 risky a insane q quit x exit There are some other commands recommended for advanced users only. More documentation about this: https://doc.tiki.org/Permission+Check Your choice [f]?


The option preselected in "Our choice" will initially be "c", to run "composer" script and get the required php dependencies for you. and in a second step, it will suggest "f", to fix file and directory permissions (classic default option). You can choose at any time the letter that best suits your needs, among the options offered.

If "sh setup.sh" doesn't work for you, you may try, in your ./tiki/ directory

Copy to clipboard
chmod -R 777 ./db ./dump ./img/wiki ./img/wiki_up ./img/trackers ./modules/cache ./temp ./temp/cache ./temp/templates_c ./templates ./styles ./whelp/

Another way is to set permissions for all directories and then set permissions for all files. For example, to set the permissions for all directories to 777 and the permissions for all files to 644, use the following separate commands through shell access:

Copy to clipboard
find [YOURDIR] -type d -exec chmod 777 {} \; find [YOURDIR] -type f -exec chmod 644 {} \;

After correcting any directory or file permission problems, visit tiki-install.php to continue.

1.6.2. SuPHP Problems

Systems with SuPHP need permissions 755 at maximum. Group must not be allowed to write. This includes the complete path in the filesystem, not only document root of the webserver. Wrong permissions may lead to 500 Internal Server Error here. On the other hand less permissions (namely 750 without x/execute/subdir entry for webserver) may lead to 403 Forbidden Error.

1.6.3. Permission Matrix

Several usecases and minimum to maximum permissions you may try if something doesn't work properly. Permissions refer to data directly accessed by the webserver (files included by Tiki itself may and should have less permissions):

Ownership
username:groupname
no SuPHP
files / subdirectories
with SuPHP
files / subdirectories
webserver:webserver
600 - 666 / 700 - 777
?
user:user
604 - 666 / 705 - 777
600 - 644 / 701 - 755
user:webserver
660 - 666 / 770 - 777
?
webserver:user
660 - 666 / 770 - 777
?

1.6.3.1. Option

For your consideration
Copy to clipboard
find . -type d -exec chmod 755 {} \; ; chmod 755 . ; find . -type f -exec chmod 755 {} \; ; chmod 751 db/local.php

1.6.3.2. Option

The following commands might be useful. In particular, it might help you use an IDE (PhpStorm), etc:

For your consideration
Copy to clipboard
$ export PathToTiki="/var/www/tiki" $ export WebServerOwner="www-data" $ sudo usermod -aG ${WebServerOwner} $(whoami) $ sudo chown -R ${WebServerOwner}: ${PathToTiki} $ sudo chmod -R g+rw ${PathToTiki}

In English, the above code adds you to the web-server group; forces the tiki tree to be owned by the web-server user and group; and then makes sure the tiki tree is readable and writable by the web-server group (you). Suggestions welcome!



在更正任何目录或文件权限问题后,访问 tiki-install.php 以继续。

1.7. tiki-install.php 更新您的数据库

(A) 全新安装

在这个 站点的 tiki-install.php 页面上,连接到与您的 站点相同的数据库(您可以在 站点的 db/local.php 文件中找到此信息),然后按照说明升级您的站点。确保单击升级而不是安装,否则会清空您的数据库。

(B) 在现有基础上安装

然后,转到 tiki-install.php 并单击“upgrade”按钮,这将更新数据库。Tiki 可以读取您之前的 db/local.php 文件并使用该信息。

如果安装程序之前被锁定(应该如此),您需要删除 db/lock 文件来解锁它。

升级期间的安全选择

在升级/安装期间有几个重要的安全选择,如下所示:

安全登录

在安装过程中配置常规设置时,有一个选项“Require secure (https) login”。建议选择此选项,以便在浏览器和站点服务器之间发送的数据保持私密。

为了实现安全登录,除了选择此选项外,您还需要一个安全证书和域名的专用 IP 地址。这些可以从您的 Web 托管公司获取或购买,或者对于安全证书,可以从第三方获取。

锁定安装程序

在安装程序的最后一步,一旦您单击按钮进入 Tiki,安装程序默认会被锁定。有一个选项可以在安装的最后一步选择 锁定安装程序。强烈建议您为任何生产站点锁定安装程序。此选项仅为开发站点提供便利。安装程序允许用户通过浏览器更改或破坏站点的数据库,因此一旦安装或升级完成,保持其锁定非常重要。

替代方案:通过 Shell 升级数据库

[+]

1.7.1. 检查升级结果

希望您看到 升级完成 消息,并且可能有一个失败操作列表(对于旧版本很常见)。如果这些消息都提示列、行或表不存在,您可以尝试忽略它们。复制并粘贴错误列表以供将来参考,勾选忽略框,然后祈祷好运。如有疑问,请将有关升级错误的问题提交给 tiki-develop 列表上的友好人士。

1.8. tiki-install.php 之后

最后,照常进入 Tiki 站点,同时禁用 tiki-install.php 脚本。

1.9. 更新 .htaccess 文件

Tiki 附带一个 _htaccess 文件。需要将其重命名为 .htaccess 并替换先前版本的那个。如果您进行了任何自定义修改,则应在新文件中重新进行。请参见:Apache Clean URLs

1.10. 重建搜索索引

转到搜索控制面板并重建搜索索引,通常清除 Tiki 缓存也是一个好主意。您可以在 Search and List from Unified Index 中找到更多详细信息。

1.11. 测试

可能出现的问题

  • 行为变化
    • 某项功能已激活但不再激活(例如,默认行为已更改)。您需要进入管理面板并激活它。
  • 错误
    • 每个 Tiki 版本都会带来大量新功能。但是,有时增强功能也会带来新错误(:smile:)
  • 如果您自定义了主题,它们可能会出现异常
    • 您应该计划一些时间将自定义内容重新整合到新主题中。
  • 如果您已将 MySQL 服务器从 4 升级到 5,则在首次登录时可能会收到“Account disabled”错误。要修复此问题:
Copy to clipboard
mysql -u user_dbuser -p user_dbname -B -e "update users_users set waiting=NULL where waiting is not NULL and valid is NULL;"

查看位置

在您版本的发行说明中查找任何需要特别关注的内容,以及每个新版本的文档页面(例如 Tiki24 LTS、Tiki25Tiki26 LTS……)

解决方法

1.11.1. 检查您的内容

检查您的新网站是否包含旧网站的所有内容。

1.11.2. 检查您过去使用的功能是否仍处于开启状态

更具体地说,结构、搜索、个别插件和其他一些功能可能需要在管理面板中重新激活。

1.11.3. 检查可能不安全的插件调用并批准或拒绝它们

从 tiki 4 开始,新增了一个管理 Tiki 插件的系统,要求对某些插件进行授权。因此,可能不安全的 Wiki 插件必须由具有批准插件相关权限的用户验证。如果您使用了此类插件,它们现在将无法工作,直到具有足够权限的用户批准它们。

现在,任何尝试使用插件的用户(包括 iframe、dbreport、tag、sql、snarf、regex……)都需要稍后由某些受信任的用户/编辑/管理员验证以批准或拒绝它们。

待审核的插件调用列表可随时在 tiki-plugins.php 查看。

1.12. 升级您的主题

请查阅 https://themes.tiki.org/Upgrading 上的说明。

更详细的描述,请阅读 Styles and Themes

需要进一步帮助?

如果您需要进一步的说明,请在 tw:Chat论坛 中提问,并请回到这里用您学到的知识升级本文档。这是您帮助并使新用户更容易使用的一种方式。

相关页面

给高级用户的说明

符号链接

当您对结果满意时,删除旧站点的目录结构,并将新站点的目录移动到相应位置。实际上,在 GNU/Linux 或其他基于 Unix 的服务器上,您通常可以使用符号链接,使升级变得容易。

Copy to clipboard
ln -s tikiwiki-3.0 tiki

MultiTiki

如果您在同一个 Tiki 实例中管理多个 Tiki 站点(MultiTiki),但将它们放在子目录中,您也可以遵循 Manual Installation 页面上的说明。

通过 Git 或 SVN 更新

如果您有 Shell 访问权限和 Git 或 SVN:dev:dev:Get Code

Tiki Manager

如果您管理许多实例,您应该考虑使用 Tiki Manager

手动升级

请参见:Manual Upgrade

从不再维护的版本升级

请参见:Upgrade from unmaintained versions

用于交换版本的 Shell 命令

2016 年更新 - 这次使用 dotglob 选项成功
如果您的新 Tiki 已全部设置好并准备好放在 path_to_your_site/tiki15 中,并且有一个新目录准备将旧版本放入(例如名为 tiki12),以下命令将所有其他内容移动到 tiki12 目录,然后将 tiki15 中的所有内容移动到站点根目录:

Copy to clipboard
# go to your tiki root cd path/to/your/tiki/install #first back everything up off you have room tar -cvzf ~/backups/htdocs-pre-update-to-15.tar.gz ./ #make a dir to put the old version in while testing mkdir tiki12 shopt -s dotglob # sets * to include hidden files # move all the old files into tiki12 find . -maxdepth 1 -not -name 'tiki12' -not -name 'tiki15' -not -name '.' -not -name '..' -exec mv {} ./tiki12 \; # move the new tiki15 site out into the doc root mv tiki15/* ./