How to use Django 2.2 with legacy PostgreSQL 8.4 database?

345 views Asked by At

I am developing a new application on Django (DRF + Angular). The current LTS version of Django 2.2. The required data is stored in the PostgreSQL 8.4 database. But Django 2.2 supports PostgreSQL 9.4 and higher. Update PostgreSQL is not possible. What to do in this situation? What are the options?

2

There are 2 answers

0
crimsonpython24 On BEST ANSWER

I think what you can do is to:

  1. dump your information in the database to a separate file
  2. uninstall and upgrade your postgres server
  3. load the earlier dumped data back to your new database

Since I don't know your operating system so I can't give you clear command-line instructions, but do check out the docs. By the way, since you're changing, why not switch to Django 3 directly? Otherwise you might've to repeat this process again.

Hope this helps

0
Tom Carrick On

Luckily you are on the minimum supported version for this, so you can use pg_upgrade to update your Postgres install (docs)

This way you don't need to dump/restore your database. The process is a little long-winded so I'll refrain from copying it all here in case this becomes out of date.