persistnce.xml file defines persistence units so you can define your one persistence unit in another file and put it on classpath. Just make sure you have different names in every persistence unit you have including the one shipped with jBPM.
Next refer to your persistence unit (by name) when creating entity manager factory prior to creating the session.
The persistence.xml started getting picked up after putting it in a MEAT-INF folder in the classpath.
I setup the new persistence.xml to point to mysql, but every time I restart my task server, I find my old pending task getting wiped off
from the db i.e. from the task table.
How can I prevent this and make sure that the human task assigned to a user is recoverable to the previous state on a server restart?
It is probably because of following property inside persistence.xml of task service:
<property name="hibernate.hbm2ddl.auto" value="create" />
change the value to update or verify once the db was successfully created.