Upgrade from Older Versions¶
Last Updated: August 2020
This document provides instructions for upgrading from versions of Tethys Platform prior to 3.0.
Upgrading from 2.1 to 3.X¶
Many significant changes were made since Tethys Platform 2.1. Please note the following differences:
Source Code¶
Tethys in now a conda package! This means that when installing tethys you will no longer clone the source code into TETHYS_HOME. Now Tethys will be installed in your conda environment instead.
TETHYS_HOME¶
In 2.1 TETHYS_HOME by default was located at ~/tethys/. As of 3.0 TETHYS_HOME is now, by default at ~/.tethys/
Note
If your tethys conda environment is named something other than tethys then TETHYS_HOME will be at ~/.tethys/<ENV_NAME>/. For example if your conda environment were named tethys-dev then TETHYS_HOME would be at ~/.tethys/tethys-dev/
Settings¶
In 2.1 custom settings were specified directly in the settings.py file. Now settings must be configured in the portal_config.yml file which is generated in TETHYS_HOME
Upgrade Steps¶
Activate Tethys environment uninstall the previous version of
tethys-platform:conda activate tethys pip uninstall tethys-platform
Install the new conda packaged version of
tethys-platform:conda install -c tethysplatform -c conda-forge tethys-platform
Rename
~/tethys/to~/.tethys/:mv ~/tethys ~/.tethys
Generate a
portal_config.ymlfile:tethys gen portal_config
Port any custom settings from your old
settings.pyto the newportal_config.yml:- Common settings that need to be copied include:
DEBUG
ALLOWED_HOSTS
DATABASES
STATIC_ROOT, TETHYS_WORKSPACES_ROOT
EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD, EMAIL_USE_TLS, DEFAULT_FROM_EMAIL
SOCIAL_OAUTH_XXXX_KEY, SOCIAL_OAUTH_XXXX_SECRET
BYPASS_TETHYS_HOME_PAGE
Refer to Tethys Portal Configuration for more details on specifying settings in the
portal_config.ymlfile.Migrate the database:
- If you have a locally installed database then you will need to add a
DIRsetting in theDATABASESsetting of theportal_config.ymlfile: DATABASES: default: NAME: tethys_platform USER: tethys_default PASSWORD: pass HOST: localhost PORT: 5436 DIR: psql
Note
The
DIRsetting is relative toTETHYS_HOME. By default the locally installed database would have been at~/tethys/psql/, but now thatTETHYS_HOMEhas moved the default location is~/.tethys/psql/.Tip
If you have a locally installed database server then you need to downgrade postgresql to the version that the database was created with.
t conda install -c conda-forge postgresql=9.5
- Once you have the database settings and dependencies configured properly then you can migrate the database by running:
tethys db migrate
Tip
Refer to the db command docs for more information on how to use the new
tethys dbcommand.- If you have a locally installed database then you will need to add a