How to upgrade¶
Before attempting any upgrade, it is highly recommended that you do a backup of all of your code, configuration files, data files, and Python virtual environment.
From 1.2.x to 1.3.x¶
KerkoApp¶
The instructions below make the assumption that you have cloned KerkoApp from its Git repository.
- Go to the KerkoApp directory.
-
Get the desired version of KerkoApp. You may check the list of available versions. To retrieve version 1.3.0, use the command below:
git fetch && git checkout 1.3.0 -
Activate your Python virtual environment.
-
Install Python dependencies:
pip install --force-reinstall -r requirements/run.txt -
Restart the application.
From 1.1.x to 1.2.x¶
KerkoApp¶
The instructions below make the assumption that you have cloned KerkoApp from its Git repository.
- Go to the KerkoApp directory.
-
Get the desired version of KerkoApp. You may check the list of available versions. To retrieve version 1.2.0, use the command below:
git fetch && git checkout 1.2.0 -
Activate your Python virtual environment.
-
Install Python dependencies:
pip install --force-reinstall -r requirements/run.txt -
Restart the application.
From 1.0.x to 1.1.x¶
KerkoApp¶
The instructions below make the assumption that you have cloned KerkoApp from its Git repository.
- Go to the KerkoApp directory.
-
Get the desired version of KerkoApp. You may check the list of available versions. To retrieve version 1.1.0, use the command below:
git fetch && git checkout 1.1.0 -
Activate your Python virtual environment.
-
Install Python dependencies:
pip install --force-reinstall -r requirements/run.txt -
Adapt your configuration file:
- Make sure the
kerko.feeds.fieldsparameter is either omitted or has at least the following values:["id", "data", "item_fields"].
- Make sure the
-
Rebuild your search index using the following commands:
flask kerko clean index flask kerko sync index -
Restart the application.
Custom applications¶
If you have a custom application, the following changes will need to be applied:
-
The application is now responsible for instantiating the blueprint by calling
kerko.make_blueprint(). Any previous uses of the globalkerko.blueprintobject must be replaced, as Kerko no longer provides it. If registration was your application's only use of that object, the change could look like:Beforeapp.register_blueprint(kerko.blueprint, url_prefix='/bibliography')Afterapp.register_blueprint(kerko.make_blueprint(), url_prefix='/bibliography')... where
appis theFlaskobject.
From 0.9 to 1.0.x¶
Version 1.0.x brings significant changes on how Kerko can be configured. Before you attempt an upgrade, reading Configuration basics is a must.
KerkoApp¶
The instructions below make the assumption that you have cloned KerkoApp from its Git repository.
- Go to the KerkoApp directory.
-
Rename the default branch of your local KerkoApp repository:
git branch -m master main git fetch origin git branch -u origin/main main git remote set-head origin -a -
Get the desired version of KerkoApp. You may check the list of available versions. To retrieve version 1.0.0, use the command below:
git fetch && git checkout 1.0.0 -
Activate your Python virtual environment.
-
Install Python dependencies:
pip install --force-reinstall -r requirements/run.txt -
Rename the
.envfile todotenv.old. We no longer want KerkoApp to use that file, but it might be useful to keep it as reference while we migrate the configuration. - Create two files,
.secrets.tomlandconfig.toml, in the KerkoApp directory, i.e., the directory wherewsgi.pyis found. - Copy the
SECRET_KEYandKERKO_ZOTERO_API_KEYlines fromdotenv.oldinto.secrets.toml. In.secrets.toml, rename theKERKO_ZOTERO_API_KEYparameter toZOTERO_API_KEY. For each of the two parameters, make sure the value following the equal sign (=) is surrounded by double quotes ("). To ascertain the syntax, you may have a look at thesample.secrets.tomlfile provided by KerkoApp. - Copy the remaining lines from
dotenv.oldtoconfig.toml. For each parameter, use the list below to determine if something special needs to be done to migrate it. Almost all configuration parameters have been renamed and/or moved into a hierarchical structure (indicated by an arrow (→)). Check the parameter values too as the syntax of a TOML file is slightly different from that of a.envfile, e.g., in TOML string values must be surrounded by double quotes ("), and booleans values must be eithertrueorfalse(lowercase, no quotes). Refer to the parameters documentation for additional information, and have a look at thesample.config.tomlfile provided by KerkoApp.DEBUG: Remove. Debug mode is now activated with the--debugcommand line option.FLASK_APP: Probably not needed anymore. In doubt, please refer to the Flask documentation on application discovery. If you do need this variable, then a.envfile could be the right place. It will not work from a TOML file. Note also that the application is now referenced aswsgi.appinstead ofkerkoapp.app.FLASK_ENV: Remove. Flask 2.3 stopped supporting it. Debug mode is now activated with the--debugcommand line option.KERKO_BOOTSTRAP_VERSION→kerko.assets.bootstrap_versionKERKO_CSL_STYLE→kerko.zotero.csl_styleKERKO_COMPOSER→kerko_composerKERKO_DATA_DIR→DATA_PATH. Now optional, relative to the instance path, and defaulting tokerkoinstead ofdata/kerko.KERKO_DOWNLOAD_ATTACHMENT_NEW_WINDOW→kerko.features.download_attachment_new_windowKERKO_DOWNLOAD_CITATIONS_LINK→kerko.features.download_resultsKERKO_DOWNLOAD_CITATIONS_MAX_COUNT→kerko.features.download_results_max_countKERKO_FEEDS→kerko.feeds.formatsKERKO_FEEDS_FIELDS→kerko.feeds.fieldsKERKO_FEEDS_MAX_DAYS→kerko.feeds.max_daysKERKO_FEEDS_REJECT_ANY→kerko.feeds.reject_anyKERKO_FEEDS_REQUIRE_ANY→kerko.feeds.require_anyKERKO_FULLTEXT_SEARCH→kerko.search.fulltextKERKO_HIGHWIREPRESS_TAGS→kerko.meta.highwirepress_tagsKERKO_JQUERY_VERSION→kerko.assets.jquery_versionKERKO_PAGE_LEN→kerko.pagination.page_lenKERKO_PAGER_LINKS→kerko.pagination.pager_linksKERKO_POPPER_VERSION→kerko.assets.popper_versionKERKO_PRINT_CITATIONS_LINK→kerko.features.print_resultsKERKO_PRINT_CITATIONS_MAX_COUNT→kerko.features.print_results_max_countKERKO_PRINT_ITEM_LINK→kerko.features.print_itemKERKO_RELATIONS_INITIAL_LIMIT→kerko.features.relations_initial_limitKERKO_RELATIONS_LINKS→kerko.features.relations_linksKERKO_RELATIONS_SORT→kerko.features.relations_sortKERKO_RESULTS_ABSTRACTS→kerko.features.results_abstractsKERKO_RESULTS_ABSTRACTS_MAX_LENGTH→kerko.features.results_abstracts_max_lengthKERKO_RESULTS_ABSTRACTS_MAX_LENGTH_LEEWAY→kerko.features.results_abstracts_max_length_leewayKERKO_RESULTS_ABSTRACTS_TOGGLER→kerko.features.results_abstracts_togglerKERKO_RESULTS_ATTACHMENT_LINKS→kerko.features.results_attachment_linksKERKO_RESULTS_FIELDS→kerko.search.result_fieldsKERKO_RESULTS_URL_LINKS→kerko.features.results_url_linksKERKO_TEMPLATE_ATOM_FEED→kerko.templates.atom_feedKERKO_TEMPLATE_BASE→kerko.templates.baseKERKO_TEMPLATE_ITEM→kerko.templates.itemKERKO_TEMPLATE_LAYOUT→kerko.templates.layoutKERKO_TEMPLATE_SEARCH→kerko.templates.searchKERKO_TEMPLATE_SEARCH_ITEM→kerko.templates.search_itemKERKO_TITLE→kerko.meta.titleKERKO_USE_TRANSLATIONS: Remove.KERKO_WHOOSH_LANGUAGE→kerko.search.whoosh_languageKERKO_WITH_JQUERY→kerko.assets.with_jqueryKERKO_WITH_POPPER→kerko.assets.with_popperKERKO_ZOTERO_API_KEY→ZOTERO_API_KEYKERKO_ZOTERO_BATCH_SIZE→kerko.zotero.batch_sizeKERKO_ZOTERO_LIBRARY_ID→ZOTERO_LIBRARY_IDKERKO_ZOTERO_LIBRARY_TYPE→ZOTERO_LIBRARY_TYPEKERKO_ZOTERO_LOCALE→kerko.zotero.localeKERKO_ZOTERO_MAX_ATTEMPTS→kerko.zotero.max_attemptsKERKO_ZOTERO_WAIT→kerko.zotero.waitKERKOAPP_CHILD_EXCLUDE_RE→kerko.zotero.child_exclude_reKERKOAPP_CHILD_INCLUDE_RE→kerko.zotero.child_include_reKERKOAPP_COLLECTION_FACETS→kerko.facets.*. See sub-parameterstype(set it to"collection"),collection_key,weight, andtitle.KERKOAPP_EXCLUDE_DEFAULT_BADGES: Remove. There is no replacement since Kerko does not provide any default badges at this point.KERKOAPP_EXCLUDE_DEFAULT_CITATION_FORMATS→kerko.citation_formats.*. See sub-parameterenable.KERKOAPP_EXCLUDE_DEFAULT_FACETS→kerko.facets.*. See sub-parameterenable.KERKOAPP_EXCLUDE_DEFAULT_FIELDS→kerko.search_fields.*. See sub-parameterenable.KERKOAPP_EXCLUDE_DEFAULT_SCOPES→kerko.scopes.*. See sub-parameterenable.KERKOAPP_EXCLUDE_DEFAULT_SORTS→kerko.sorts.*. See sub-parameterenable.KERKOAPP_FACET_INITIAL_LIMIT_LEEWAY→kerko.facets.*.initial_limit_leeway. This is now set individually for each facet, and there is no longer a global parameter.KERKOAPP_FACET_INITIAL_LIMIT→kerko.facets.*.initial_limit. This is now set individually for each facet, and there is no longer a global parameter.KERKOAPP_ITEM_EXCLUDE_RE→kerko.zotero.item_exclude_reKERKOAPP_ITEM_INCLUDE_RE→kerko.zotero.item_include_reKERKOAPP_MIME_TYPES→kerko.zotero.attachment_mime_typesKERKOAPP_TAG_EXCLUDE_RE→kerko.zotero.tag_exclude_reKERKOAPP_TAG_INCLUDE_RE→kerko.zotero.tag_include_rePROXY_FIX→kerkoapp.proxy_fix.*
- If you are using a translated version of Kerko, the default "Bibliography"
link of the navigation bar no longer gets translated because it is now defined
by a configuration parameter. To replace it, set the
kerko.link_groups.navbarparameter (see the parameters documentation for details). - If your configuration changes neither the
DATA_PATHnor theINSTANCE_PATHparameters, then rename KerkoApp'sdatadirectory toinstance. - Make sure your WSGI server now references the application as
wsgi.app(orwsgi:app) instead ofkerkoapp.app(orkerkoapp:app). -
Rebuild your search index using the following commands:
flask kerko clean index flask kerko sync index -
Restart the application.
Custom templates¶
Occurrences of parameter names in custom templates will need to be edited. For example:
config.KERKO_COMPOSER→config.kerko_composerconfig.KERKO_TITLE→config.kerko.meta.title- ... for the full list, please refer to the above section.
The following item fields have been renamed. Occurrences of these in your templates will need to be edited:
z_dateAdded→date_addedz_dateModified→date_modified
The following views have been renamed. Occurrences of these in your templates (perhaps in calls to url_for) will need to be edited:
item_citation_download→item_bib_downloadsearch_citation_download→search_bib_download
Custom applications¶
Configuration initialization and loading has greatly changed. If you have a custom application, it will need to be adapted even if you do not plan to use TOML files. See Creating a custom application for a working example, and refer to the changelog for other breaking changes.