0

am trying to connect postgresql database with a table already created (legacy). Not much documentation on the Internet to do so as the database already created. Am afraid to lose the data. Any guide to do that. Am using Windows and gitbash and have pgadmin4. Still learning. Default database in settings file changed to my database but what's next migrate or inspectdb or create tables in django?! Any help is appreciated.

Ab6578
  • 15
  • 3
  • There is documentation on the subject in the official docs https://docs.djangoproject.com/en/3.2/howto/legacy-databases/. What have you tried and what exactly are you struggling with? – Iain Shelvington Nov 22 '21 at 14:56
  • step 1: dump legacy the data into a json file. step 2: load data from json file into new db. You can also manage both dbs at the same time just add another db into your settings file. Useful command: `python manage.py inspectdb > txt.py` to take a look at the db and mange it with your django app (if you want). You can also create a seperate admin for the second db and work with that. django is really nice with leacy projects – hansTheFranz Nov 22 '21 at 15:06

0 Answers0