Upgrading to Silva 3.0


This page documents the steps that I took to upgrade a medium sized Silva 2.3.7 site to Silva 3.0.1. I hope that this can be useful to other people who wish to upgrade to the latest version of Silva.

It's always a good idea to start by looking at the 3.0 documentation on Infrae's site, specifically the API changes if you have custom code or have made other modifications to Silva's code. Upgrade Silva and Zope instances

I began by following the documentation that Infrae has for upgrading your installation, paying particular attention to the Silva 3.0 upgrade-specific notes.

I had two code sources that were broken and needed to be fixed. They were the cs_toc and cs_citation sources, which are shipped with Silva. On the edit screen in the ZMI for each code source I changed the "File system location" from "No location" to the "Products.SilvaExternalSources" path provided. After saving, I then clicked on "Update from filesystem". This fixed the code sources.

The only problem I encountered was during the re-indexing of Silva Agenda Items. Prior to Silva 3.0.2, there was a bug with generating the key used for the index. You can read about it on Launchpad. Upgrade custom code

This is a list of specific changes that I made to my various custom packages:

As documented in the API changes, CatalogedVersion and CatalogVersionedContent have been removed from Silva 3.0. I had some code which made use of those, and upgrading required changing them to Version and VersionedContent, respectively.
The methods in the ISecurity interface defined in silva.core.interfaces are no longer prefixed by sec_. (So sec_get_last_author_info() -> get_last_author_info().)
The method get_assets() in the IContainer interface defined in silva.core.interfaces has been removed. It can be replaced by IFolder's get_non_publishables(interface=IAsset).
The "Hide from tables of content" (hide_from_tocs) setting has moved from the metadata set silva-extra to silva-settings.
Accessing files located in a package's ./static directory via /++resource++ no longer works. A better way is to use /++static++. An even better way is to use self.static['filename'] in your Python code and let Silva figure out the URL for you!
The various implements_{interface} methods defined in Products.Silva.ViewCode have been removed. All they did was to return I{Interface}.providedBy(self). so they should be easy to replace in your code.
If you have a customized login form by using grok.name('silva_login_form.html') in a class, be aware that the names of the HTML fields have changed, and you'll have to update your form to match or else you won't be able to log in. (The default login form is located in silva.pas.base.Membership_templates)

Revision History:

2013-03-21: A couple minor edits
2013-03-11: Initial publication