16 | | === 2. Update the Trac Code #UpdatetheTracCode |
17 | | |
18 | | Get the new version as described in TracInstall, or through your operating system package manager. |
19 | | |
20 | | If you already an earlier version of Trac installed via `easy_install`, it might be easiest to also use `easy_install` to upgrade your Trac installation: |
21 | | |
22 | | {{{#!sh |
23 | | easy_install --upgrade Trac |
24 | | }}} |
25 | | |
26 | | You may also want to remove the pre-existing Trac code by deleting the `trac` directory from the Python `lib/site-packages` directory, or remove Trac `.egg` files from former versions. |
27 | | 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 typical: |
28 | | * on Linux: `/usr/lib/python2.X/site-packages` |
29 | | * on Windows: `C:\Python2.X\lib\site-packages` |
30 | | * on MacOSX: `/Library/Python/2.X/site-packages` |
31 | | |
32 | | You may also want to remove the directory in which your static resources are [TracInstall#cgi-bin deployed]. The exact location depends on your platform. This cleanup is not mandatory, but makes it easier to troubleshoot issues later on, as your installation is uncluttered by code or templates from a previous release that is not used anymore. As usual, make a backup before actually removing things. |
33 | | |
34 | | === 3. Upgrade the Trac Environment #UpgradetheTracEnvironment |
| 26 | === 3. Update Trac and dependencies #UpdatetheTracCode |
| 27 | |
| 28 | The packages are available through several channels, as described in [trac:TracDownload]. If your Trac instance was installed through an operating system package manager or an installer on Windows, proceed with standard steps that are appropriate for your operating system. |
| 29 | |
| 30 | If you are managing your Trac installation using command line tools, `pip` is the preferred tool to upgrade a Trac instance because it will uninstall the old version. The following command will upgrade your Trac installation using the package published to [https://pypi.python.org/pypi/Trac PyPI]. |
| 31 | |
| 32 | {{{#!sh |
| 33 | $ pip install --upgrade Trac |
| 34 | }}} |
| 35 | |
| 36 | The upgrade command will give you the latest release of Trac. If instead you wish to upgrade to a different version, such as a minor release of Trac when there is a newer major release available, then specify the Trac version in the `pip` command. |
| 37 | |
| 38 | {{{#!sh |
| 39 | $ pip install --upgrade Trac==1.2.1 |
| 40 | }}} |
| 41 | |
| 42 | You should also upgrade dependencies so they are compliant with the [TracInstall#Dependencies required versions] and upgrade Trac plugins. |
| 43 | |
| 44 | === 4. Upgrade the Trac Environment #UpgradetheTracEnvironment |
164 | | ==== Upgrading from Trac 0.11 to Trac 0.12 |
165 | | |
166 | | ===== Python 2.3 no longer supported |
167 | | |
168 | | The minimum supported version of Python is now 2.4. |
169 | | |
170 | | ===== SQLite v3.x required |
171 | | |
172 | | SQLite v2.x is no longer supported. If you still use a Trac database of this format, you'll need to convert it to SQLite v3.x first. See [trac:PySqlite#UpgradingSQLitefrom2.xto3.x] for details. |
173 | | |
174 | | ===== [trac:PySqlite] 2 required |
175 | | |
176 | | [trac:PySqlite] 1.1.x is no longer supported. Please install 2.5.5 or later if possible, see [#Tracdatabaseupgrade Trac database upgrade] below. |
177 | | |
178 | | ===== Obsolete Plugins |
179 | | |
180 | | Trac has added functionality equivalent to the following plugins: |
181 | | |
182 | | * [https://trac-hacks.org/wiki/AutoQueryPlugin AutoQueryPlugin] |
183 | | * [https://trac-hacks.org/wiki/AdminConsoleProviderPatch AdminConsoleProviderPatch] |
184 | | * [https://trac-hacks.org/wiki/AnchorMacro AnchorMacro]: see WikiFormatting#SettingAnchors |
185 | | * [https://trac-hacks.org/wiki/TicketChangePlugin TicketChangePlugin]: see [TracPermissions#TicketSystem TICKET_EDIT_COMMENT permission] |
186 | | * [https://trac-hacks.org/wiki/TicketDeletePlugin TicketDeletePlugin]: see `tracopt.ticket.deleter` |
187 | | * [https://trac-hacks.org/wiki/SubversionLocationPlugin SubversionLocationPlugin]: see TracRepositoryAdmin#Repositories |
188 | | * [https://trac-hacks.org/wiki/WikiCreoleRendererPlugin WikiCreoleRendererPlugin]: see [trac:WikiCreole] |
189 | | * [https://trac-hacks.org/wiki/RepoRevisionSyntaxPlugin RepoRevisionSyntaxPlugin] (added in 0.12.1) |
190 | | |
191 | | The plugins should be removed when upgrading Trac to 0.12. |
192 | | |
193 | | ===== Multiple Repository Support |
194 | | |
195 | | The latest version includes support for multiple repositories. If you plan to add more repositories to your Trac instance, please refer to TracRepositoryAdmin#Migration. |
196 | | |
197 | | This may be of interest to users with only one repository, since there is now a way to avoid the potentially costly resync check at every request. |
198 | | |
199 | | ===== Resynchronize the Trac Environment Against the Source Code Repository |
200 | | |
201 | | Each [TracEnvironment Trac environment] must be resynchronized against the source code repository in order to avoid errors such as "[trac:#6120 No changeset ??? in the repository]" while browsing the source through the Trac interface: |
202 | | |
203 | | {{{#!sh |
204 | | trac-admin /path/to/projenv repository resync '*' |
205 | | }}} |
206 | | |
207 | | ===== Improved repository synchronization |
208 | | |
209 | | In addition to supporting multiple repositories, there is now a more efficient method for synchronizing Trac and your repositories. |
210 | | |
211 | | While you can keep the same synchronization as in 0.11 adding the post-commit hook as outlined in TracRepositoryAdmin#Synchronization and TracRepositoryAdmin#ExplicitSync will allow more efficient synchronization and is more or less required for multiple repositories. |
212 | | |
213 | | Note that if you were using the `trac-post-commit-hook`, ''you're strongly advised to upgrade it'' to the new hook documented in the above references and [TracWorkflow#Howtocombinethetracopt.ticket.commit_updaterwiththetestingworkflow here], as the old hook will not work with anything else than the default repository and even for this case, it won't trigger the appropriate notifications. |
214 | | |
215 | | ===== Authz permission checking |
216 | | |
217 | | The authz permission checking has been migrated to a fine-grained permission policy. If you use authz permissions (aka `[trac] authz_file` and `authz_module_name`), you must add `AuthzSourcePolicy` in front of your permission policies in `[trac] permission_policies`. You must also remove `BROWSER_VIEW`, `CHANGESET_VIEW`, `FILE_VIEW` and `LOG_VIEW` from your global permissions with `trac-admin $ENV permission remove` or the "Permissions" admin panel. |
218 | | |
219 | | ===== Microsecond timestamps |
220 | | |
221 | | All timestamps in database tables, except the `session` table, have been changed from "seconds since epoch" to "microseconds since epoch" values. This change should be transparent to most users, except for custom reports. If any of your reports use date/time columns in calculations (e.g. to pass them to `datetime()`), you must divide the values retrieved from the database by 1'000'000. Similarly, if a report provides a calculated value to be displayed as a date/time (i.e. with a column named "time", "datetime", "changetime", "date", "created" or "modified"), you must provide a microsecond timestamp, that is, multiply your previous calculation with 1'000'000. |
222 | | |
223 | | ==== Upgrading from Trac 0.10 to Trac 0.11 |
224 | | |
225 | | ===== Site Templates and Styles |
226 | | |
227 | | The templating engine has changed in 0.11 to Genshi, please look at TracInterfaceCustomization for more information. |
228 | | |
229 | | If you are using custom CSS or modified templates in the `templates` directory of the TracEnvironment, you will need to convert them to the Genshi way of doing things. To continue to use your style sheet, follow the instructions at TracInterfaceCustomization#SiteAppearance. |
230 | | |
231 | | ===== Trac Macros, Plugins |
232 | | |
233 | | The Trac macros will need to be adapted, as the old-style wiki-macros are not supported anymore due to the drop of [trac:ClearSilver] and the HDF. They need to be converted to the new-style macros, see WikiMacros. When they are converted to the new style, they need to be placed into the plugins directory instead and not wiki-macros, which is no longer scanned for macros or plugins. |
234 | | |
235 | | ===== For FCGI/WSGI/CGI users |
236 | | |
237 | | For those who run Trac under the CGI environment, run this command in order to obtain the trac.*gi file: |
238 | | {{{#!sh |
239 | | trac-admin /path/to/env deploy /deploy/directory/path |
240 | | }}} |
241 | | |
242 | | This will create a deploy directory with the following two subdirectories: `cgi-bin` and `htdocs`. Then update your Apache configuration file `httpd.conf` with this new `trac.cgi` location and `htdocs` location. |
243 | | |
244 | | ===== Web Admin plugin integrated |
245 | | |
246 | | If you had the [trac:WebAdmin] plugin installed, you can uninstall it as it is part of the Trac code base since 0.11. |
247 | | |
248 | | ===== New Default Configurable Workflow |
249 | | |
250 | | When you run `trac-admin <env> upgrade`, your `trac.ini` will be modified to include a `[ticket-workflow]` section. The workflow configured in this case is the original workflow, so that ticket actions will behave like they did in 0.10: |
251 | | |
252 | | {{{#!Workflow width=500 height=240 |
253 | | leave = * -> * |
254 | | leave.operations = leave_status |
255 | | leave.default = 1 |
256 | | accept = new -> assigned |
257 | | accept.permissions = TICKET_MODIFY |
258 | | accept.operations = set_owner_to_self |
259 | | resolve = new,assigned,reopened -> closed |
260 | | resolve.permissions = TICKET_MODIFY |
261 | | resolve.operations = set_resolution |
262 | | reassign = new,assigned,reopened -> new |
263 | | reassign.permissions = TICKET_MODIFY |
264 | | reassign.operations = set_owner |
265 | | reopen = closed -> reopened |
266 | | reopen.permissions = TICKET_CREATE |
267 | | reopen.operations = del_resolution |
268 | | }}} |
269 | | |
270 | | There are some significant caveats in this, such as accepting a ticket sets it to 'assigned' state, and assigning a ticket sets it to 'new' state. So you will probably want to migrate to "basic" workflow; [trac:source:trunk/contrib/workflow/migrate_original_to_basic.py contrib/workflow/migrate_original_to_basic.py] may be helpful. See TracWorkflow for a detailed description of the new basic workflow. |
271 | | |
272 | | === 7. Restart the Web Server #RestarttheWebServer |
273 | | |
274 | | If you are not running [wiki:TracCgi CGI], reload the new Trac code by restarting your web server. |
| 182 | ==== Upgrading from older versions of Trac #OlderVersions |
| 183 | |
| 184 | For upgrades from versions older than Trac 0.12, refer first to [trac:wiki:0.12/TracUpgrade#SpecificVersions]. |
| 185 | |
| 186 | For upgrades from versions older than Trac 0.10, refer first to [trac:wiki:0.10/TracUpgrade#SpecificVersions]. |