transferring data between Postgres databases

27 views
Skip to first unread message

Mike Dewhirst

unread,
Oct 24, 2016, 12:05:05 AM10/24/16
to Django users
I have a user who has done a lot of work (instead of playing) in the
staging server and now wants to get that work into the production database.

I'm about to research selective dump and load capabilities of Postgres
but in the meantime can anyone suggest any shortcuts?

Thanks

Mike

Aaron C. de Bruyn

unread,
Oct 24, 2016, 12:10:21 AM10/24/16
to django...@googlegroups.com
If you're talking about migrating data using tools outside of django,
I've used SQLWorkbench[0] in the past.
I currently use it to selectively sync a handful of tables out of a
~900 table database *in* to my Django app.

[0] - http://www.sql-workbench.net/

-A
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ba85f65-b90c-c786-d112-96168cfbd9ca%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.

Mike Dewhirst

unread,
Oct 24, 2016, 1:11:13 AM10/24/16
to django...@googlegroups.com
On 24/10/2016 3:08 PM, 'Aaron C. de Bruyn' via Django users wrote:
> If you're talking about migrating data using tools outside of django,
> I've used SQLWorkbench[0] in the past.
> I currently use it to selectively sync a handful of tables out of a
> ~900 table database *in* to my Django app.

Aaron, thanks for that. Do you know if it will handle a bunch of related
records in many tables to be copied as a related "set" to the other
database. Both databases have identical structures.

M

Vineet Kothari

unread,
Oct 24, 2016, 3:01:16 AM10/24/16
to django...@googlegroups.com

You will have to dump the back up file for that you can either use GUI based tool as other friends has suggested or you can use command line .There may be more ways please read two scoops of Django book


On Oct 24, 2016 9:39 AM, "'Aaron C. de Bruyn' via Django users" <django...@googlegroups.com> wrote:
If you're talking about migrating data using tools outside of django,
I've used SQLWorkbench[0] in the past.
I currently use it to selectively sync a handful of tables out of a
~900 table database *in* to my Django app.

[0] - http://www.sql-workbench.net/

-A

On Sun, Oct 23, 2016 at 9:04 PM, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> I have a user who has done a lot of work (instead of playing) in the staging
> server and now wants to get that work into the production database.
>
> I'm about to research selective dump and load capabilities of Postgres but
> in the meantime can anyone suggest any shortcuts?
>
> Thanks
>
> Mike
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4ba85f65-b90c-c786-d112-96168cfbd9ca%40dewhirst.com.au.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Erik Cederstrand

unread,
Oct 24, 2016, 4:12:47 PM10/24/16
to Django Users

> Den 24. okt. 2016 kl. 06.04 skrev Mike Dewhirst <mi...@dewhirst.com.au>:
>
> I have a user who has done a lot of work (instead of playing) in the staging server and now wants to get that work into the production database.
>
> I'm about to research selective dump and load capabilities of Postgres but in the meantime can anyone suggest any shortcuts?

How much data are we talking about? Is it too much for django-admin dumpdata/loaddata to handle?

Erik

Mike Dewhirst

unread,
Oct 24, 2016, 5:10:36 PM10/24/16
to django...@googlegroups.com
Erik and others who have replied; thank you.

I have slept on the problem and decided I have to do the work to turn
the requirement into a data-transfer feature.

The data is not voluminous but is somewhat complex. Companies have
divisions. Divisions have substances. Substances have complex properties
gathered into many different related tables. Some are 1:1, some are 1:m
and then it gets tricky.

Substances have one current safety data sheet (SDS) and one under
user-developemt to be ready in due course to become the new current SDS.
SDSs have releationships with each other as they are legal documents and
need to persist indefinitely in a daisy-chain going back in time to the
big bang. The idea is that workplace safety depends on information on
substances. Lawyers earn money by blaming as many people as possible if
their client has a valid claim for injury. SDSs change as the science
changes or the regulations change or measuring technology changes or
knowledge improves. They must be reviewed every few years anyway even if
nothing has changed.

Each SDS has many sds_hazard records each of which has a relationship
with one reference hazard. It also has many precaution records and many
pictogram (png or jpg hazard symbol) records. Then there are phrases,
reference URLs for academic papers and so it goes.

I forgot to mention that a mixture has its own properties and SDS chain.
A mixture is a substance too. In fact it is a substance with ingredients
which are other substances. Mixture properties are calculated from
ingredient properties and/or entered by users.

Might be talking myself out of my overnight decision.

Thanks for listening.

Mike


The above summary will end up in a ticket for the data-transfer feature.
I can see it is going to be more complex than the users will ever
understand. Having built their
Reply all
Reply to author
Forward
0 new messages