djangopostgresqldockercookiecutter

Cookiecutter Django project postgres migrating to new host


I have a cookiecutter django template project working fine with a local postgres database.

(https://cookiecutter-django.readthedocs.io/en/latest/)

I've copied the git repository and recreated the docker images on a new host to run in production, but I would like to export/copy my data as well.

What's the recommended way to move the data over from the postgres docker instance ?

Thanks


Solution

  • You can generate a JSON output of all database data using the dumpdata command in Django. Transfer the JSON file to your host, and then reimport the data into the database. Refer to this article for a comprehensive guide on reading detailed instructions on the entire process.

    https://cpske.github.io/ISP/django/data-import-export