The latency issue of the cloud-centric IoT management system has motivated Fog and Edge Computing (FEC) architecture, which distributes the tasks from the cloud to the edge resources such as routers, switches or the IoT devices themselves. Specifically, mobile sensors of IoT system can also carry certain tasks for FEC. Considering the need of dynamic process migration from the mobile sensors to other resources when the mobile sensors unable to continue their tasks, the IoT system needs to provide a flexible mechanism that allows the mobile sensors dynamically migrate their tasks to the other FEC resource at runtime. However, it raises a question in what is the optimal approach when the mobile sensors intend to migrate their tasks to multiple heterogeneous FEC resource? In order to address the question, the authors propose REM scheme, which is capable of optimising the process migration decision. Further, in order to realise such a system and to validate the REM scheme, the authors have developed EPIoT host framework. Finally, the authors have implemented and have evaluated the REM scheme and framework, the results have shown that the REM scheme is capable of enhancing the performance of the process migration in heterogeneous FEC environment.