Skip to content

Upgrading to v2.2 [2025]

Ryan Hodges edited this page May 19, 2025 · 2 revisions

Upgrading ITKDB to v2.2

In 2025, many partners are getting upgraded to the first officially numbered release v2.2. This means if your current version was installed before 2025 (and you do NOT see a version number in the top left of your admin window) you likely will need to perform several of these steps to upgrade to v2.2, and then follow the release guides for upgrading each step going forward.

Operating System

If running Ubuntu 20.04 or older

  • Let partner know the OS is no longer supported ("EOL")
  • Propose plan and explore budget to migrate
    • Migration will be easier starting with v2.3

If running Ubuntu 22.04:

  • Note for our records.
  • Inform partners that they should plan to migrate by or before April 2027.

Backups

Server Backups

  • Consult with IT dept to see if this is possible
    • Rebootable image is preferable
    • If they only take file-level backups, do the dumps below FIRST
  • If on AWS, be sure to take a snapshot of your EBS

Dumps

  • Automatic
    • Request permission before testing, as this will result in ALL of their DB data being sent (encrypted) over the internet and stored (unencrypted) on your hard drive
      • DELETE IMMEDIATELY!
    • If this fails:
      • Running with DEBUG=True can reveal the cause
        • this is not safe -- not recommended for any instance running on the Internet.
      • Common issues
        • Incorrect permissions in media folder
          • sudo chown -R ubuntu:www-data /usr/local/apps/TEKDB/TEKDB/media/__pycache__
  • Manual
    • dj export_db
    • if that fails:
      • Data dump
        • dj dumpdata --indent=2 > /tmp/ITK_data_dump.json
      • Media Dump
        • determine settings.MEDIA_ROOT
        • zip -r /tmp/TEKDB_media.zip <MEDIA_ROOT>
    • Copy the resulting files off from the server if acceptable
      • These files are created in /tmp, which is deleted on each reboot.

Migration Status

dj showmigrations > ~/TEKDB_migration_status_<DATE>.txt

Repository Status

git log > ~/TEKDB_repo_status_<DATE>.txt

Update

Automatic Script

sudo /usr/local/apps/TEKDB/scripts/Linux/update.sh

Manual

You may need to adjust the first to commands for:

  1. The location of your local repository root
  2. the location where you installed your Python virtual environment
cd /usr/local/apps/TEKDB
source env/bin/activate
git pull
pip install -r TEKDB/requirements.txt
pip install -r TEKDB/requirements_linux.txt
dj collectstatic --no-input
dj migrate
sudo service uwsgi restart
sudo service nginx restart

Configuration

Carefully compare

  • /usr/local/apps/deployment/tekdb_nginx.conf
    • with
  • /etc/nginx/sites_enabled/THIS__FILE

In Particular:

  • add_header X-Frame-Options "SAMEORIGIN";
    • and
  • add_header Content-Scurity-Policy "frame-ancestors 'self' *.your.url"; set this last value to match the URL that users are accessing your app at, with the wildcard * replacing any subdomain you may use.

Testing

Django Test

dj test TEKDB.tests

Manual Tests

If you can access the site

  • Does the site load?
  • Run some searches
  • Check for A/V media
  • How does the header icon (and other styles) look?

If you can access the admin

  • When you try to add a relationship to a Record, does the pop-up iFrame load?
  • When you attempt to delete a record with relationships, does it allow you to?
Clone this wiki locally