Building migration routine