﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24178	Moving production data to a new database	liwee	nobody	"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?"	Uncategorized	closed	Migrations	1.7	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
