Moving DB to new machine

10 показвания
Преминаване към първото непрочетено съобщение

Greg

непрочетено,
14.04.2014 г., 8:49:1814.04.14 г.
до south...@googlegroups.com
Hi,

We have a customer that runs our app locally and is now moving to our shared server.  The shared server has multiple DBs and settings.py files.  Each DB on the shared server has migrations applied at the same time.  The DB moving over is at the same state as all of the other DBs but had differently named migrations applied.  How do I get this new DB to not try to apply all of the existing migrations sitting on the shared server?  Reading the docs I believe I just have to use --fake to get it to think all of the existing migrations have been applied.  But, I thought it best to confirm this.

Thanks.

Andrew Godwin

непрочетено,
14.04.2014 г., 10:19:2814.04.14 г.
до south...@googlegroups.com
Yes, --fake is the correct thing to use to modify a server's recorded migration data without actually unapplying or applying the migrations. Be careful, though, as it's easy to get your migration state screwed up this way.

Andrew


--
You received this message because you are subscribed to the Google Groups "South Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to south-users...@googlegroups.com.
To post to this group, send email to south...@googlegroups.com.
Visit this group at http://groups.google.com/group/south-users.
For more options, visit https://groups.google.com/d/optout.

Greg

непрочетено,
14.04.2014 г., 11:19:0814.04.14 г.
до south...@googlegroups.com
Thank you.  I'm assuming you mean if I wanted to roll back a migration?  That should be fine as we never do.
Just to be consistent I'll probably empty the new DB's migrationhistory table before doing the fake.  Then their table will look like everyone else's.

Shai Berger

непрочетено,
14.04.2014 г., 17:16:0614.04.14 г.
до south...@googlegroups.com
On Monday 14 April 2014 18:19:08 Greg wrote:
> Thank you. I'm assuming you mean if I wanted to roll back a migration?
> That should be fine as we never do.
> Just to be consistent I'll probably empty the new DB's migrationhistory
> table before doing the fake. Then their table will look like everyone
> else's.
>

You'll need to do this anyway, otherwise you end up with ghost migrations.

Greg Miller

непрочетено,
14.04.2014 г., 22:14:2414.04.14 г.
до south...@googlegroups.com
Just to recap for future users...
We moved the DB, pg_restored it,
emptied south_migrationhistory
./manage.py migrate app --fake

All seems perfect.  We'll see next migration.  Thanks all.



--
You received this message because you are subscribed to a topic in the Google Groups "South Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/south-users/JlFZ7M4apdQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to south-users...@googlegroups.com.
Отговор до всички
Отговор до автора
Препращане
0 нови съобщения