Changes between Version 46 and Version 47 of TracUpgrade
- Timestamp:
- Dec 6, 2007, 3:43:28 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracUpgrade
v46 v47 2 2 [[TracGuideToc]] 3 3 4 A [wiki:TracEnvironment Trac environment] sometimes needs to be upgraded before it can be used with a new version of Trac. This document describes the steps necessary to upgrade an environment.4 A [wiki:TracEnvironment Trac environment] needs to be upgraded before it can be used with Trac-0.11. This document describes the steps necessary to upgrade an environment. 5 5 6 '''Note''': ''Environment upgrades are not necessary for minor version releases unless otherwise noted. For example, there's no need to upgrade a Trac environment created with (or upgraded) 0.8.0 when installing 0.8.4 (or any other 0.8.x release).''6 '''Note''': ''Environment upgrades are not necessary for minor version releases unless otherwise noted. 7 7 8 == General Instructions == 8 '''Note''': ''A database change is required, so it is no longer safe to switch back from 0.11 to 0.10. 9 10 '''Beware:''' milestone:0.11 still says it is safe to switch between 0.10.4 and 0.11dev 11 12 == Instructions == 9 13 10 14 Typically, there are four steps involved in upgrading to a newer version of Trac: … … 12 16 === Update the Trac Code === 13 17 14 Get the new version of Trac, either by downloading an offical release package or by checking it out from the [http://projects.edgewall.com/trac/wiki/SubversionRepository Subversion repository].18 Get the new version as described in wiki:0.11/TracInstall, or your operation system specific procedure. 15 19 16 If you 're doing a major version upgrade (such as from 0.8 to 0.9), it is ''highly'' recommended that you first remove the existing Trac code. To do this, you need to deletethe `trac` directory from the Python `lib/site-packages` directory.20 If you do a manual (not operating system specific) upgrade, you may also later on want to remove the existing Trac code by deleting the `trac` directory from the Python `lib/site-packages` directory. 17 21 18 22 The location of the site-packages directory depends on the operating system, and the location in which Python was installed. However, the following locations are common: … … 20 24 * If you’re using Windows: C:\Python2.X\lib\site-packages 21 25 * If you’re using MacOSX: /Library/Python2.X/site-packages 22 * If you’re using NetBSD or pkgsrc: /usr/pkg/lib/python2.X/site-packages23 * If you're using FreeBSD : /usr/local/lib/python2.X/site-packages24 25 26 26 27 You may also want to remove the Trac `cgi-bin`, `htdocs`, `templates` and `wiki-default` directories that are commonly found in a directory called `share/trac` (the exact location depends on your platform). 27 28 28 If you have a source distribution, you need to run 29 {{{ 30 python setup.py install 31 }}} 29 > If You had the webadmin components, You should disable (remove from config file) webadmin.* - now Admin is part of the Trac code base. 32 30 33 to install the new version. If you've downloaded the Windows installer, you execute it, and so on. 31 34 32 35 33 === Upgrade the Trac Environment === 36 34 37 Unless noted otherwise, upgrading between major versions (such as 0.8 and 0.9) involves changes to the database schema, and possibly the layout of the [wiki:TracEnvironment environment directory]. Fortunately, Trac providesautomated upgrade scripts to ease the pain. These scripts are run via [wiki:TracAdmin trac-admin]:35 After restarting, Trac should show the instances which need a manual upgrade via the automated upgrade scripts to ease the pain. These scripts are run via [wiki:TracAdmin trac-admin]: 38 36 {{{ 39 37 trac-admin /path/to/projenv upgrade … … 56 54 Note that this procedure will of course leave your `WikiStart` page intact. 57 55 56 === Trac Macros, Plugins === 57 The Trac macros will need to be adapted, as the old-style wiki-macros are not supported anymore (due to the drop of ClearSilver and the HDF); they need to be converted to the new-style macros. 58 59 58 60 === Restart the Web Server === 59 60 In order to reload the new Trac code you will need to restart your web server (note this is not necessary for [wiki:TracCgi CGI]). 61 If you are not running [wiki:TracCgi CGI], reload the new Trac code by restarting your web server. 61 62 62 63 == Known Issues == 63 64 === Customized Templates === 65 66 Sometimes, the ClearSilver templates files have been locally modified, and placed in a special location referred to by the `[trac] templates_dir` configuration setting. 67 68 When upgrading to a newer version, changes in the Trac source are usually concerning ''both'' the Python source code and the template markup, so they must be kept in sync. 69 Upgrading the code base and still using the old templates (even not customized!) is a recipe for trouble: 70 - ''Link and images missing for folders in the TracBrowser component (and tooltip saying "Access Denied")'' (#3915) 71 - ''Report execution failed: Report ... has no SQL query'' (#3715) 64 === parent dir === 65 If you use a trac parent env configuration and one of the plugines in one child does not work, none of the children work. 72 66 73 67 == Changing Database Backend == … … 76 70 The [http://trac-hacks.org/wiki/SqliteToPgScript sqlite2pg] script on [http://trac-hacks.org trac-hacks.org] has been written to assist in migrating a SQLite database to a PostgreSQL database 77 71 78 == SpecificVersions ==72 == Older Versions == 79 73 80 The following sections discuss any extra actions that may need to be taken to upgrade to specific versions of Trac. 81 82 == From 0.9.x to 0.10.x == 83 84 Due to some changes in the Wiki syntax, you may notice that certain parts of your pages no longer work as expected: 85 * Previously, links to images would result in that image being embedded into the page. Since 0.10, links to images remain plain links. If you want to embed an image in the page, use the `[[Image]]` macro. 86 * You can no longer use `%20` in wiki links to encode spaces. Instead, you should quote the name containing spaces (for example, use `wiki:"My page"` instead of `wiki:My%20page`.) 87 88 Several enhancements have been made to the version control subsystem, in particular for the support of scoped repositories has been improved. 89 It is recommended that you perform a [TracAdmin#InteractiveMode trac-admin] '''`resync`''' operation to take advantage of these improvements. 90 91 Also note that the argument list of the [TracAdmin trac-admin] '''`initenv`''' command has changed: there's a new argument for determining the type of version control system. The old usage was: 92 {{{ 93 initenv <projectname> <db> <repospath> <templatepath> 94 }}} 95 The new usage is: 96 {{{ 97 initenv <projectname> <db> <repostype> <repospath> <templatepath> 98 }}} 99 If you're using any scripts that automate the creation of Trac environments, you will need to update them. If you're using Subversion, specify `svn` for the `<repostype>` argument. 100 101 == From 0.9.3 to 0.9.4 == 102 103 There is a bug in Pysqlite 1.x that causes reports using the "%" character for `LIKE` clauses or date formatting to fail. You will need to use escape the percent characters with another: "%%". 104 105 == From 0.9.x to 0.9.3 or later == 106 107 If you are using plugins you might need to upgrade them. See http://projects.edgewall.com/trac/milestone/0.9.3 for further details. 108 109 == From 0.9-beta to 0.9 == 110 111 If inclusion of the static resources (style sheets, javascript, images) is not working, check the value of the `htdocs_location` in trac.ini. For [wiki:TracModPython mod_python], [wiki:TracStandalone Tracd] and [wiki:TracFastCgi FastCGI], you can simply remove the option altogether. For [wiki:TracCgi CGI], you should fix it to point to the URL you mapped the Trac `htdocs` directory to (although you can also remove it and then [wiki:TracCgi#MappingStaticResources map the static resources]). If you're still having problems after removing the option, check the paths in the `trac/siteconfig.py` file and fix them if they're incorrect. 112 113 If you've been using plugins with a beta release of Trac 0.9, or have disabled some of the built-in components, you might have to update the rules for disabling/enabling components in [wiki:TracIni trac.ini]. In particular, globally installed plugins now need to be enabled explicitly. See TracPlugins and TracIni for more information. 114 115 If you want to enable the display of all ticket changes in the timeline (the “Ticket Details” option), you now have to explicitly enable that in [wiki:TracIni trac.ini], too: 116 117 {{{ 118 [timeline] 119 ticket_show_details = true 120 }}} 121 122 == From 0.8.x to 0.9 == 123 124 [wiki:TracModPython mod_python] users will also need to change the name of the mod_python handler in the Apache HTTPD configuration: 125 {{{ 126 from: PythonHandler trac.ModPythonHandler 127 to: PythonHandler trac.web.modpython_frontend 128 }}} 129 130 If you have [http://initd.org/tracker/pysqlite PySQLite] 2.x installed, Trac will now try to open your SQLite database using the SQLite 3.x file format. The database formats used by SQLite 2.8.x and SQLite 3.x are incompatible. If you get an error like ''“file is encrypted or is not a database”'' after upgrading, then you must convert your database file. 131 132 To do this, you need to have both SQLite 2.8.x and SQLite 3.x installed (they have different filenames so can coexist on the same system). Then use the following commands: 133 {{{ 134 $ mv trac.db trac2.db 135 $ sqlite trac2.db .dump | sqlite3 trac.db 136 }}} 137 138 To update multiple database files at once on linux you may use the following command (replace {{{/var/trac}}} withe the location where your trac installtions reside): 139 {{{ 140 $ find /var/trac/ -iname "trac.db" | xargs -i bash -c "mv {} {}.2; sqlite {}.2 .dump | sqlite3 {};" 141 }}} 142 143 Remember to give the webserver write permission to trac.db. 144 145 After testing that the conversion was successful, the `trac2.db` file can be deleted. For more information on the SQLite upgrade see http://www.sqlite.org/version3.html. 146 147 == From 0.7.x to 0.8 == 148 149 0.8 adds a new roadmap feature which requires additional permissions. While a 150 fresh installation will by default grant ROADMAP_VIEW and MILESTONE_VIEW 151 permissions to anonymous, these permissions have to be granted manually when 152 upgrading: 153 {{{ 154 $ trac-admin /path/to/projectenv permission add anonymous MILESTONE_VIEW 155 $ trac-admin /path/to/projectenv permission add anonymous ROADMAP_VIEW 156 }}} 74 For upgrades from former versions refer to TracUpgrade. 157 75 158 76 -----