#24178: Moving production data to a new database
-------------------------------+--------------------
     Reporter:  liwee          |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.7
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Hi,

 When I move my production data to a new server, ideally I try to follow
 the steps

 Old server
 1. ftp source files from repo
 2. run migration
 3. backup database

 New server
 4. ftp source files from repo (migration directory is non-existent)
 5. restore database
 6. run migration (faked)

 The problem occurs when there are some model changes in repo and steps 1 &
 2 are left out.

 E.g.

 In old server, both database and model.py match, i.e. both have foo1:
 {{{
   class foo(models.Model):
     foo1 = models.CharField()
 }}}

 however, the model.py in repo has been rename from foo1->foo2
 and when step 6 is executed, migration detects the table foo and fakes the
 initial migration. it assumes that the table foo contains foo2 according
 to model.py while in reality the table foo contains foo1
 {{{
   class foo(models.Model):
     foo2 = models.CharField()
 }}}

 at this point, no errors are detected. the problem occurs during the next
 code change, i.e. foo2->foo3. migration cannot locate foo2 in the table
 foo.
 {{{
   class foo(models.Model):
     foo3 = models.CharField()
 }}}

 Is it possible to add some sort of field verification when the initial
 migration is faked at step 6?

--
Ticket URL: <https://code.djangoproject.com/ticket/24178>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.7a5385106a8973ead47e8825a7a870df%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to