How to clone a entity with its attached fields? I am trying to create a entity with few bundles. I have used EntityDefaultUIController as admin UI callback. This provides me with few default functions such as clone, import and export. The problem is when I try to clone or export the entity. It does not export or clone the fields attached to it. Has anyone faced similar issues. I traced back the issue to entity_ui_get_form function which does not have any function related to getting the field information. How could I clone entity with its fields attached to it? 

Kindly help me figure this out.
A recent module called Replicate provides an API to easily clone any entity, including of course its fields and references.