Automated updating of data across staging and production environments?

72 views
Skip to first unread message

Sithembewena Lloyd Dube

unread,
Jul 26, 2012, 6:10:33 AM7/26/12
to django...@googlegroups.com
Hi all,

We have an Ubuntu Linux server which is running virtual environments (one for staging, one for prod.). Our clients test their sites on the staging environment and then proceed to capture the same data on the live sites. They want to be able to, at the click of a button, migrate only the latest data to the live sites. If users have submitted new data (e.g. contact requests) on the prod. server, this data must not be affected.

Is it possible to achieve this, and if so, are there any tools oout there to consider? Any feedback would be appreciated.

Thanks.

--
Regards,
Sithembewena Lloyd Dube

Kevin Daum

unread,
Jul 26, 2012, 9:50:07 AM7/26/12
to django...@googlegroups.com
Sithembewena,
Have you considered using the same database for staging and production? Then the problem would be solved by purging the old test data they no longer want, which I think would be much easier than partial, conditional synchronization. 

Kevin

Victor Rocha

unread,
Jul 26, 2012, 10:29:58 AM7/26/12
to django...@googlegroups.com
I partly agree with the above question. It's a solution, but you usually never want to use your production database on a development server. 

As for his problem, I would look into fabric. You can easily write a function that dumps data from one database and into another.


On Thursday, July 26, 2012 6:10:33 AM UTC-4, Lloyd Dube wrote:

Kevin Daum

unread,
Jul 27, 2012, 11:00:13 AM7/27/12
to django...@googlegroups.com
Do you need to preload the staging database with production data in order to properly test the site? If not, you could create a fresh staging database (no data) every time you update staging. After people test it and if there are no issues, you could use dumpdata with natural keys to export the staging data. Then convert the primary keys to null. Finally, use loaddata to load the data into the production database. Using Fabric, as Victor mentioned, would be a step towards automating the process.

Kevin

Sithembewena Lloyd Dube

unread,
Jul 28, 2012, 9:25:20 AM7/28/12
to django...@googlegroups.com
Hi all,

@Kevin - nope, the test database always has other data in it. I need to fetch the subset (ie the new stuff each time) and transfer that to the live db.

Thanks for all the suggestions, we are looking into Fabric.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-5TLxRPI8J4J.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Reply all
Reply to author
Forward
0 new messages