| 1 |
Upgrade Instructions |
|---|
| 2 |
==================== |
|---|
| 3 |
|
|---|
| 4 |
A Trac environment sometimes needs to be upgraded before it can be used with |
|---|
| 5 |
a new version of Trac. This document describes the steps necessary to upgrade |
|---|
| 6 |
an environment. |
|---|
| 7 |
|
|---|
| 8 |
Note that you should also read the trac/wiki/default-pages/TracUpgrade |
|---|
| 9 |
documentation file present in the source distribution. |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
Note that Environment upgrades are not necessary for minor version releases |
|---|
| 13 |
unless otherwise noted. For example, there's no need to upgrade a Trac |
|---|
| 14 |
environment created with (or upgraded) 0.8.0 when installing 0.8.4 (or any |
|---|
| 15 |
other 0.8.x release). |
|---|
| 16 |
|
|---|
| 17 |
General Instructions |
|---|
| 18 |
-------------------- |
|---|
| 19 |
Typically, there are four steps involved in upgrading to a newer version of |
|---|
| 20 |
Trac: |
|---|
| 21 |
|
|---|
| 22 |
1. Update the Trac Code |
|---|
| 23 |
|
|---|
| 24 |
Get the new version of Trac, either by downloading an offical release package |
|---|
| 25 |
or by checking it out from the Subversion repository. |
|---|
| 26 |
|
|---|
| 27 |
If you have a source distribution, you need to run |
|---|
| 28 |
|
|---|
| 29 |
python setup.py install |
|---|
| 30 |
|
|---|
| 31 |
to install the new version. If you've downloaded the Windows installer, you |
|---|
| 32 |
execute it, and so on. |
|---|
| 33 |
|
|---|
| 34 |
In any case, if you're doing a major version upgrade (such as from 0.8 to |
|---|
| 35 |
0.9), it is highly recommended that you first remove the existing Trac code. |
|---|
| 36 |
To do this, you need to delete the `trac` directory from the Python |
|---|
| 37 |
`lib/site-packages` directory. You may also want to remove the Trac `cgi-bin`, |
|---|
| 38 |
`htdocs` and `templates` directories that are commonly found in a directory |
|---|
| 39 |
called `share/trac` (the exact location depends on your platform). |
|---|
| 40 |
|
|---|
| 41 |
2. Upgrade the Trac Environment |
|---|
| 42 |
|
|---|
| 43 |
Unless noted otherwise, upgrading between major versions (such as 0.8 and |
|---|
| 44 |
0.9) involves changes to the database schema, and possibly the layout of the |
|---|
| 45 |
environment. Fortunately, Trac provides automated upgrade scripts to ease the |
|---|
| 46 |
pain. These scripts are run via `trac-admin`: |
|---|
| 47 |
|
|---|
| 48 |
trac-admin /path/to/projenv upgrade |
|---|
| 49 |
|
|---|
| 50 |
This command will do nothing if the environment is already up-to-date. |
|---|
| 51 |
|
|---|
| 52 |
3. Update the Trac Documentation |
|---|
| 53 |
|
|---|
| 54 |
Every Trac environment includes a copy of the Trac documentation for the |
|---|
| 55 |
installed version. As you probably want to keep the included documentation in |
|---|
| 56 |
sync with the installed version of Trac, `trac-admin` provides a command to |
|---|
| 57 |
upgrade the documentation: |
|---|
| 58 |
|
|---|
| 59 |
trac-admin /path/to/projenv wiki upgrade |
|---|
| 60 |
|
|---|
| 61 |
Note that this procedure will of course leave your `WikiStart` page intact. |
|---|
| 62 |
|
|---|
| 63 |
4. Restart the Web Server |
|---|
| 64 |
|
|---|
| 65 |
In order to reload the new Trac code you will need to restart your web |
|---|
| 66 |
server (note this is not necessary for CGI). |
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
The following sections discuss any extra actions that may need to be taken |
|---|
| 70 |
to upgrade to specific versions of Trac. |
|---|
| 71 |
|
|---|
| 72 |
From 0.10.x to 0.11.x |
|---|
| 73 |
--------------------- |
|---|
| 74 |
|
|---|
| 75 |
There should not be any serious problems... |
|---|
| 76 |
|
|---|
| 77 |
However, take a look at the following documented caveats:: |
|---|
| 78 |
|
|---|
| 79 |
http://trac.edgewall.org/wiki/TracDev/ReleaseNotes/0.11#Caveats |
|---|
| 80 |
|
|---|
| 81 |
Also, you should be careful to check that the plugins you depend on have |
|---|
| 82 |
been ported to 0.11, as they most probably won't work without adaptation |
|---|
| 83 |
due to the numerous internal changes that occurred during 0.11 development. |
|---|
| 84 |
Note however that Clearsilver based plugin are still supported. |
|---|
| 85 |
|
|---|
| 86 |
See: http://trac.edgewall.org/wiki/TracDev/ApiChanges/0.11 |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
From 0.9.x to 0.10.x |
|---|
| 90 |
-------------------- |
|---|
| 91 |
Due to some changes in the Wiki syntax, you may notice that certain parts of |
|---|
| 92 |
your pages no longer work as expected: |
|---|
| 93 |
|
|---|
| 94 |
* Previously, links to images would result in that image being embedded |
|---|
| 95 |
into the page. Since 0.10, links to images remain plain links. If you |
|---|
| 96 |
want to embed an image in the page, use the [[Image]] macro. |
|---|
| 97 |
* You can no longer use %20 in wiki links to encode spaces. Instead, you |
|---|
| 98 |
should quote the name containing spaces |
|---|
| 99 |
(for example, use wiki:"My page" instead of wiki:My%20page.) |
|---|
| 100 |
|
|---|
| 101 |
Several enhancements have been made to the version control subsystem, in |
|---|
| 102 |
particular for the support of scoped repositories has been improved. It is |
|---|
| 103 |
recommended that you perform a "trac-admin resync" operation to take |
|---|
| 104 |
advantage of these improvements. |
|---|
| 105 |
|
|---|
| 106 |
Also note that the argument list of the "trac-admin initenv" command has |
|---|
| 107 |
changed: there's a new argument for determining the type of version |
|---|
| 108 |
control system. The old usage was: |
|---|
| 109 |
|
|---|
| 110 |
initenv <projectname> <db> <repospath> <templatepath> |
|---|
| 111 |
|
|---|
| 112 |
The new usage is: |
|---|
| 113 |
|
|---|
| 114 |
initenv <projectname> <db> <repostype> <repospath> <templatepath> |
|---|
| 115 |
|
|---|
| 116 |
If you're using any scripts that automate the creation of Trac environments, |
|---|
| 117 |
you will need to update them. If you're using Subversion, specify "svn" for |
|---|
| 118 |
the <repostype> argument. |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
From 0.9.3 to 0.9.4 |
|---|
| 122 |
------------------- |
|---|
| 123 |
There is a bug in Pysqlite 1.x that causes reports using the "%" character |
|---|
| 124 |
for LIKE clauses or date formatting to fail. You will need to use escape the |
|---|
| 125 |
percent characters with another: "%%". |
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
From 0.9.x to 0.9.3 |
|---|
| 129 |
------------------- |
|---|
| 130 |
If you are using plugins you might need to upgrade them. See |
|---|
| 131 |
http://trac.edgewall.org/milestone/0.9.3 for further details. |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
From 0.9-beta to 0.9 |
|---|
| 135 |
-------------------- |
|---|
| 136 |
If inclusion of the static resources (style sheets, javascript, images) is not |
|---|
| 137 |
working, check the value of the `htdocs_location` in trac.ini. For mod_python, |
|---|
| 138 |
Tracd and FastCGI, you can simply remove the option altogether. For CGI, you |
|---|
| 139 |
should fix it to point to the URL you mapped the Trac `htdocs` directory to. |
|---|
| 140 |
|
|---|
| 141 |
If you've been using plugins with a beta release of Trac 0.9, or have |
|---|
| 142 |
disabled some of the built-in components, you might have to update the rules |
|---|
| 143 |
for disabling/enabling components in trac.ini. In particular, globally |
|---|
| 144 |
installed plugins now need to be enabled explicitly. See the TracPlugins and |
|---|
| 145 |
TracIni wiki pages for more information. |
|---|
| 146 |
|
|---|
| 147 |
If you want to enable the display of all ticket changes in the timeline (the |
|---|
| 148 |
Ticket Details option), you now have to explicitly enable that in trac.ini, |
|---|
| 149 |
too: |
|---|
| 150 |
|
|---|
| 151 |
[timeline] |
|---|
| 152 |
ticket_show_details = true |
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
From 0.8.x to 0.9 |
|---|
| 156 |
----------------- |
|---|
| 157 |
mod_python users will need to change the name of the mod_python handler in |
|---|
| 158 |
the Apache HTTPD configuration: |
|---|
| 159 |
|
|---|
| 160 |
from: PythonHandler trac.ModPythonHandler |
|---|
| 161 |
to: PythonHandler trac.web.modpython_frontend |
|---|
| 162 |
|
|---|
| 163 |
If you have PySQLite 2.x installed, Trac will now try to open your SQLite |
|---|
| 164 |
database using the SQLite 3.x file format. The database formats used by |
|---|
| 165 |
SQLite 2.8.x and SQLite 3.x are incompatible. If you get an error like "file |
|---|
| 166 |
is encrypted or is not a database" after upgrading, then you must convert |
|---|
| 167 |
your database file. |
|---|
| 168 |
|
|---|
| 169 |
To do this, you need to have both SQLite 2.8.x and SQLite 3.x installed (they |
|---|
| 170 |
have different filenames so can coexist on the same system). Then use the |
|---|
| 171 |
following commands: |
|---|
| 172 |
|
|---|
| 173 |
mv trac.db trac2.db |
|---|
| 174 |
sqlite trac2.db .dump | sqlite3 trac.db |
|---|
| 175 |
|
|---|
| 176 |
After testing that the conversion was successful, the `trac2.db` file can be |
|---|
| 177 |
deleted. For more information on the SQLite upgrade see |
|---|
| 178 |
http://www.sqlite.org/version3.html. |
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
From 0.7.x to 0.8 |
|---|
| 182 |
----------------- |
|---|
| 183 |
0.8 adds a new roadmap feature which requires additional permissions. While a |
|---|
| 184 |
fresh installation will by default grant `ROADMAP_VIEW` and `MILESTONE_VIEW` |
|---|
| 185 |
permissions to anonymous, these permissions have to be granted manually when |
|---|
| 186 |
upgrading: |
|---|
| 187 |
|
|---|
| 188 |
trac-admin /path/to/projectenv permission add anonymous MILESTONE_VIEW |
|---|
| 189 |
trac-admin /path/to/projectenv permission add anonymous ROADMAP_VIEW |
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
From 0.6.x to 0.7 |
|---|
| 193 |
----------------- |
|---|
| 194 |
Trac 0.7 introduced a new database format, requiring manual upgrade. |
|---|
| 195 |
|
|---|
| 196 |
Previous versions of Trac stored wiki pages, ticket, reports, settings, |
|---|
| 197 |
etc. in a single SQLite database file. Trac 0.7 replaces this file |
|---|
| 198 |
with a new backend storage format; the 'Trac Environment', which is a |
|---|
| 199 |
directory containing an SQLite database, a human-readable configuration file, |
|---|
| 200 |
log-files and attachments. |
|---|
| 201 |
|
|---|
| 202 |
Fear not though, old-style Trac databases can easily be converted to |
|---|
| 203 |
Environments using the included `tracdb2env` program as follows: |
|---|
| 204 |
|
|---|
| 205 |
tracdb2env /path/to/old/project.db /path/to/new/projectenv |
|---|
| 206 |
|
|---|
| 207 |
`tracdb2env` will create a new environment and copy the information from the |
|---|
| 208 |
old database to the new environment. The existing database will not be |
|---|
| 209 |
modified. |
|---|
| 210 |
|
|---|
| 211 |
You also need to update your apache configuration: |
|---|
| 212 |
|
|---|
| 213 |
Change the line: |
|---|
| 214 |
|
|---|
| 215 |
SetEnv TRAC_DB "/path/to/old/project.db" |
|---|
| 216 |
|
|---|
| 217 |
to: |
|---|
| 218 |
|
|---|
| 219 |
SetEnv TRAC_ENV "/path/to/new/projectenv" |
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
---- |
|---|
| 223 |
|
|---|
| 224 |
If you have trouble upgrading Trac, please ask questions on the mailing list: |
|---|
| 225 |
|
|---|
| 226 |
<http://trac.edgewall.org/wiki/MailingList> |
|---|
| 227 |
|
|---|
| 228 |
Or for other support options, see: |
|---|
| 229 |
|
|---|
| 230 |
<http://trac.edgewall.org/wiki/TracSupport> |
|---|