views:

76

answers:

2

Hello, newbie here.

I have a local Postgres database which will be filled with data (daily) on my local development machine. What is a good solution to transfer/sync/mirror this data to a production Postgres database.

For what it's worth I'm developing in Python using Django.

Thanks!

A: 

This seems like a strange workflow for me. Wouldn't it be much better to import the data in the production database and then just sync it with your development db from time to time? IMO, the development machine shouldn't be included in the production data workflow.

That's the way I do it using fabric. I've written a simple function which copies part of the production db onto the local development machine.

Haes
Thanks appreciate your help!
Emilio
A: 

South is a great tool for dealing with database migrations in Django projects. The latest release now supports both schema and data migrations

http://south.aeracode.org/docs/tutorial/part3.html#data-migrations

The app provides a number of management commands which allow you to dump executable files which when run can alter the database schema or insert records. It's great for automating changes to a production environment or when working on a team. You could then use something like fabric (or do it manually if you must) to push up the migration files and run the migrate command to populate your database

Garethr
Thanks appreciate your help! Started to give south a try before, will try again.
Emilio