-
Setup postgres server See
README-devel.md
. Note that the postresql-server package must be installed. -
Check django database configuration
To dump the existing sqlite database, the database in datavis/settings/default.py
should be sqlite:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(VAR_LIB_DIR, 'db.sqlite3'),
'OPTIONS': {'timeout': 60,},
}
}
- Save clientstate fields from existing sqlite database
python3 manage.py dumpdata --indent 2 sessions.session ncharts.variabletimes \
ncharts.clientstate_data_times ncharts.clientstate > /tmp/datadump.json
- Switch django database configuration
In datavis/settings/default.py
set DATABASES to postgresql:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'ncharts',
'CONN_MAX_AGE': 10,
}
}
-
Create and initialize the postgres database
Follow instructions in
README-devel.md
orREADME-prod.md
. -
Restore clientstate fields
python3 manage.py loaddata /tmp/datadump.json
- Restart ncharts