How to clone an entity? I created a custom entity type using entity_info_hook and associative hooks. It works fine. Now  I want to  create a clone of the entity when I press the button Duplicate. Is there any method for this? I read Replicate module do this finely. But I can't find any sufficient tutorial for the purpose. How can I use entity_ui_clone_entity() in my module?
You could call Replicate's  replicate_entity_by_id($entity_type, $id) method. And maybe hook it's API for custom behavior, see here.

entity_ui_clone_entity won't create the new entity, but only prepare your entity for creation, and could be used like this:

$my_clone = entity_ui_clone_entity('your_bundle', $my_entity);
entity_save('your_bundle', $my_clone);


Or if you created a method for saving your entity, use it direclty:

my_entity_save($my_clone);