confluence 数据库配置文件存储在 confluence 家目录下,文件名称为 confluence.cfg.xml,将其中的 hibernate.connection.url 配置项进行修改:
<property>jdbc:mysql://IP:3306/confluence_smc?sessionVariables=storage_engine%3DInnoDB</property> <!-- 将以上内容修改为如下( 添加&useUnicode=true&characterEncoding=utf8 )--> <!-- 添加这部分内容是由于数据库中字符集和排序已经修改为 utf8,如果不添加这部分配置会导致升级 5.x 版本时无法同步新的数据库结构,导致表缺失 --> <property>jdbc:mysql://IP:3306/confluence_smc?sessionVariables=storage_engine%3DInnoDB&useUnicode=true&characterEncoding=utf8</property>需要注意的是,如果使用 mysql 5.7 版本,也需要将其中的 storage_engine 修改为 default_storage_engine
三、升级至 confluence 4.3.7 版本confluence 4.X 中能升级的最大版本是 v4.3.7,所以先将 wiki 升级至 4.3.7 版本,步骤如下:
将原 wiki 服务进程停止,下载 4.3.7 版本安装包至 /opt 目录下,下载链接:https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-4.3.7-x64.bin
执行该二进制文件进行升级:
[root@localhost opt]# ./atlassian-confluence-4.3.7-x64.bin Unpacking JRE ... Starting Installer ... This will install Confluence 4.3.7 on your computer. OK [o, Enter], Cancel [c] Choose the appropriate installation or upgrade option. Please choose one of the following: Express Install (uses default settings) [1], Custom Install (recommended for advanced users) [2], Upgrade an existing Confluence installation [3, Enter] # 选择升级 confluence Existing installation directory: [/opt/atlassian/confluence] # 指定 confluence 的安装路径 Back Up Confluence Home The upgrade process will automatically back up your Confluence Installation Directory. You can also choose to back up your existing Confluence Home Directory. Both directories are backed up as zip archive files in their respective parent directory locations. We strongly recommend choosing this option in the unlikely event that you experience problems with the upgrade and may require these backups to restore your existing Confluence installation. If you have many attachments in your Confluence Home Directory, the zip archive of this directory may consume a significant amount of disk space. Back up Confluence home ? Yes [y, Enter], No [n] # 备份 confluence 的家目录,如果此前已经做过备份,此处可选择 No n Checking for local modifications. List of modifications made within Confluence directories. The following provides a list of file modifications within the confluence directory. Modified files: confluence/WEB-INF/lib/atlassian-extras-2.4.jar Removed files: (none) Added files: (none) [Enter] Checking if your instance of Confluence is running Upgrade Check List Back up your external database We strongly recommend you back up your Confluence database if you have not already done so. Please refer to the following URL for back up guidelines: +Backup+Strategy Check plugin compatibility Check that your non-bundled plugins are compatible with Confluence 4.3.7. For more information see our documentation at the following URL: +and+Configuring+Plugins+using+the+Universal+Plugin+Manager Please ensure you have read the above checklist before upgrading. Your existing Confluence installation is about to be upgraded! Do you want to proceed? Upgrade [u, Enter], Exit [e] Your instance of Confluence is currently being upgraded. Checking if Confluence has been shutdown... Backing up the Confluence installation directory Deleting the previous Confluence installation directory... Extracting files ... Please wait a few moments while Confluence starts up. Launching Confluence ... Installation of Confluence 4.3.7 is complete Your installation of Confluence 4.3.7 is now ready and can be accessed via your browser. Custom modifications Your previous Confluence installation contains customisations that must be manually transferred. Refer to our documentation more information: +Confluence#UpgradingConfluence-custommodifications Confluence 4.3.7 can be accessed at :8090 Confluence 4.3.7 may take several minutes to load on first start up. Finishing installation ...