Django handles the migration of the database very well; however, there are various changes to SEED that may require some custom (manual) migrations. The migration documenation includes the required changes based on deployment and development for each release.
In order to support Redis passwords, the configuration of the Redis/Celery settings changed a bit. You will need to add the following to your local_untracked.py configuration file. If you are using Docker then you will not need to do this.
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
If you are using a password, then in your local_untracked.py configuration, add the password to the CACHES configuration option. Your final configuration should look like the following in your local_untracked.py file
CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
'LOCATION': "127.0.0.1:6379",
'OPTIONS': {
'DB': 1,
'PASSWORD': 'password',
},
'TIMEOUT': 300
}
}
CELERY_BROKER_URL = 'redis://:%s@%s/%s' % (
CACHES['default']['OPTIONS']['PASSWORD'],
CACHES['default']['LOCATION'],
CACHES['default']['OPTIONS']['DB']
)
CELERY_RESULT_BACKEND = CELERY_BROKER_URL
CELERY_TASK_DEFAULT_QUEUE = 'seed-local'
CELERY_TASK_QUEUES = (
Queue(
CELERY_TASK_DEFAULT_QUEUE,
Exchange(CELERY_TASK_DEFAULT_QUEUE),
routing_key=CELERY_TASK_DEFAULT_QUEUE
),
)
- There are no special migrations needed for this version. Simply run ./manage.py migrate.
- This migration will run a match/merge/pair/link method upon migration. Make sure to run the migration manually and not inside of the docker container using the ./deploy.sh script.
- Make sure to backup the database before peforming the migration.
- Run ./manage.py migrate.
- The migrations should work without additional support. Simply run ./manage.py migrate. There are no manual migrations needed for the 2.6.1 release.
Version 2.6.0 includes support for meters and time series data storage. In order to use this release you must first install [timescaledb](https://docs.timescale.com/v1.2/getting-started).
Docker-based deployments shouldn't require running any additional commands for installation. The timescaledb installation will happen automatically when updating the postgres container. Also, the installation of the extension occurs in a Django migration.
sudo add-apt-repository ppa:timescale/timescaledb-ppa
sudo apt update
sudo apt install timescaledb-postgresql-10
sudo timescaledb-tune
sudo service postgresql restart
brew tap timescale/tap
brew install timescaledb
/usr/local/bin/timescaledb_move.sh
timescaledb-tune
brew services restart postgresql
- There are no manual migratios that are needed. The ./manage.py migrate command may take awhile
to run since the migration requires the recalculation of all the normalized addresses to parse bldg correct and to cast the result as a string and not a bytestring.
- The migrations should work by simply running ./manage.py migrate. There are no manual migrations needed for the 2.5.1 release.
Add the MapQuest API key to your organization.
On deployment, the error below is indicative that you need to install the extensions in the postgres database. Run docker exec <postgres_container_id> update-postgis.sh.
django.db.utils.OperationalError: could not open extension control file "/usr/share/postgresql/11/extension/postgis.control": No such file or directory
If you are using a copied version of the docker-compose.yml file (e.g., for OEP support), then you need to change 127.0.0.1:5000/postgres to 127.0.0.1:5000/postgres-seed
- Delete your bower directory rm -rf seed/static/vendors.
- Delete your css directory rm -rf seed/static/seed/css.
- Remove these lines from local_untracked.py if you have them.
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
STATICFILES_STORAGE = DEFAULT_FILE_STORAGE
- Run pip3 install -r requirements/local.txt.
- Run npm install from root checkout of SEED.
- If testing geocoding, then sign up for as a MapQuest Developer and create a new MapQuest Key.
- Add the key to the organization that you are using in development.
- Update your DATABASES engine to be django.contrib.gis.db.backends.postgis
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'seeddb',
'USER': 'seeduser',
'PASSWORD': 'seedpass',
'HOST': 'localhost',
'PORT': '5432',
}
}
- Run ./manage.py migrate