Function to copy datastore entity