Page:
DatabaseUpdate
Pages
0x_id
API
Configuration
Customization
DatabaseUpdate
Docker
GoogleMapsAPI
Home
IMDb
MultilingualAnnotations
MultipleAudioTracks
MyFavoriteBugs
Places
QuerySyntax
RenamingFiles
UpgradeTo14.04
UpgradeTo16.04
UpgradeTo18.04
UpgradeTo20.04
UpgradeToPython3
UseCases
WikipediaTemplate
config
database backup
embed
filenames
groups
ids
install
ldap
media
metadata
objects
permissions
posterservice
services
shell
ssl
text
todo
urls
video
volume
No results
1
DatabaseUpdate
j edited this page 2023-07-02 12:57:13 +05:30
Table of Contents
Upgrading Database to South
first time you update from a version without South you have to manually sync your db and after that initialize your database and fake all previous south transactions:
- if your repositroy revision is below 2327, you want to update to 2327, migrate to south and update to latest version after that
bzr pull -r2327
cd src/python-ox
bzr pull
- manualy sync database to current layout(see below)
- make sure south is installed
cd /srv/pandora
./bin/pip install South
- sync south db
cd /srv/pandora/pandora
./manage.py syncdb
- populate south history
./manage.py migrate --all --fake
Manually Syncing Database
First check for changes in the database:
cd /srv/pandora/pandora
./manage.py sqldiff -a
If you have any you can pipe the diff into dbshell to apply them. make sure nothing gets dropped that contains data.
cd /srv/pandora/pandora
./manage.py sqldiff -a | ./manage.py dbshell
Sometimes it is required to set defaults for rows. In that case you have to open dbshell and set them manually:
./manage.py dbshell
UPDATE archive_file SET info = '{}' WHERE info IS NULL;
UPDATE archive_file SET path_info = '{}' WHERE path_info IS NULL;