Get configurable product attributes and products children #Magento

load configurable product
$product = Mage::getModel('catalog/product')->load($productId);

get simple produts’ ids
$childIds = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($product->getId());

get simple products
$childProducts = Mage::getModel('catalog/product_type_configurable')
->getUsedProducts(null,$product);

get configurable options
$productAttributeOptions = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);
$attributeOptions = array();
foreach ($productAttributeOptions as $productAttribute) {
foreach ($productAttribute['values'] as $attribute) {
$attributeOptions[$productAttribute['label']][$attribute['value_index']] = $attribute['store_label'];
}
}

Convert Simple Products to Configurable Products

Into the database. If you now go into your database, find the ‘catalog_product_entity’ table. You’ll see a column called ‘type_id’. Search for the entity_id as the product_id. This should largely be set to ‘simple’. This needs to be changed to ‘configurable’.

Back to the products. So, back in the Magento admin, if you find one of the products that you’ve just converted to configurable, it will ask you to ‘Select Configurable Attributes’. You’ll see all of the descriptions, images prices are still there.

Adding Simple Products. In the side tabs, select ‘Associated Products’. Here, you can use the quick add form to add the variants of your configurable product.

http://blog.beetleweb.com/2012/05/magento-convert-simple-products-to-configurable-products/