public function run(){
//search all customer.
$collection = Mage::getModel("customer/customer")->getCollection()->addAttributeToSelect("*");
//->addFieldToFilter("email",'bobo.wang@bysoftchina.com');
foreach ($collection as $customer) {
if ($customer->getDefaultShippingAddress()) {
$addressId = $customer->getDefaultShippingAddress()->getId();
$address = Mage::getModel('customer/address')->load($addressId);
$address->setCustomerId($customer->getId())
->setIsDefaultBilling('1');
$address->save();
var_dump('customer:'. $customer->getEmail());
var_dump($address->getData());
var_dump('save default billing id:'.$addressId.' successed!');
} else {
var_dump('customer:'. $customer->getEmail() . ' has no default shipping address');
}
}
}