Upgrade 6.x to 7.1x¶
UPDATED: It is now for migrating from T6 to T7.1 (instead of T7.0).
Step 1: Back up your site and database¶
If you’re using docker, just backup your docker container:
docker commit <site_name> backup/<site_name>:<your tag>
Step 2: Update some files¶
These 4 files need to be updated:
conf/settings.py
conf/local_settings.py
conf/local_urls.py
deploy.py
conf/settings.py:
Replace:
TEMPLATE_DIRS += (os.path.join(PROJECT_ROOT, "themes"),)
With:
TEMPLATES[0]['DIRS'] += (os.path.join(PROJECT_ROOT, "themes"),)
Replace:
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.static',
'tendenci.apps.base.context_processors.newrelic',)
With:
TEMPLATES[0]['OPTIONS']['context_processors'] += (
'django.core.context_processors.static',
'tendenci.apps.base.context_processors.newrelic',)
Also, check your addons to make sure they are T7 compatible. If they are not, comment out these two lines.
from tendenci.apps.registry.utils import update_addons
INSTALLED_APPS = update_addons(INSTALLED_APPS, SITE_ADDONS_PATH)
conf/local_settings.py:
Replace:
'OPTIONS': {'autocommit': True},
With:
'autocommit': True,
Remove:
TEMPLATE_CONTEXT_PROCESSORS = get_setting('TEMPLATE_CONTEXT_PROCESSORS')
Remove:
SOUTH_MIGRATION_MODULES = { 'explorer': 'explorer.south_migrations', }
Replace:
'committees',
'case_studies',
'donations',
'speakers',
'staff',
'studygroups',
'videos',
'testimonials',
With:
'tendenci.apps.committees',
'tendenci.apps.case_studies',
'tendenci.apps.donations',
'tendenci.apps.speakers',
'tendenci.apps.staff',
'tendenci.apps.studygroups',
'tendenci.apps.videos',
'tendenci.apps.testimonials',
'tendenci.apps.social_services',
conf/local_urls.py
Replace:
('^', include('committees.urls')),
('^', include('case_studies.urls')),
('^', include('donations.urls')),
('^', include('speakers.urls')),
('^', include('staff.urls')),
('^', include('studygroups.urls')),
('^', include('videos.urls')),
('^', include('testimonials.urls')),
With:
('^', include('tendenci.apps.committees.urls')),
('^', include('tendenci.apps.case_studies.urls')),
('^', include('tendenci.apps.donations.urls')),
('^', include('tendenci.apps.speakers.urls')),
('^', include('tendenci.apps.staff.urls')),
('^', include('tendenci.apps.studygroups.urls')),
('^', include('tendenci.apps.videos.urls')),
('^', include('tendenci.apps.testimonials.urls')),
(r'^', include('tendenci.apps.social_services.urls')),
deploy.py
Replace with the content of https://github.com/tendenci/tendenci-project-template/blob/master/deploy.py
Step 3: Update files in requirements directory¶
Add a file tendenci.txt and replace all files with the content in the directory https://github.com/tendenci/tendenci-project-template/tree/master/requirements
Step 4: Remove south and common addons modules from environment¶
pip uninstall -y South
pip uninstall -y tendenci-case-studies
pip uninstall -y tendenci-committees
pip uninstall -y tendenci-donations
pip uninstall -y tendenci-speakers
pip uninstall -y tendenci-staff
pip uninstall -y tendenci-studygroups
pip uninstall -y tendenci-videos
Note
For some reason, we were not able to make a clean install in docker containers. We ended up rebuilding the dist-packages.
rm -rf /usr/local/lib/python2.7/dist-packages
mkdir /usr/local/lib/python2.7/dist-packages
chmod g+w /usr/local/lib/python2.7/dist-packages
curl https://bootstrap.pypa.io/get-pip.py | sudo python
Step 5: Install requirements¶
pip install -r requirements.txt --upgrade
Note
If you encountered the error “bash: /usr/bin/pip: No such file or directory” or similar, please exit and re-enter the container then try again.
Step 5: Fake initials¶
python manage.py fake_initials
Note
If you encountered the error “no module ‘testimonials’ is installed” or similar, please check if ‘testimonials’ is removed from INSTALLED_APPS in conf/local_settings.py.
Step 6: Run deploy¶
# If you encountered an error saying `salutation` already exists,
# you'll need to fake events 0003 `python manage.py migrate events 0003 --fake`
# then rerun the command `python manage.py migrate`.
# You'll also need to fake files 0002 `python manage.py migrate files 0002 --fake`
python manage.py migrate
python deploy.py
If everything goes well, restart your site.