How to move EC2 instance to another ECS cluster
You need to follow these steps:


Set ECS_CLUSTER=devcluster in /etc/ecs/ecs.config
Stop all tasks/containers
Remove checkpoint file - /var/lib/ecs/data/ecs_agent_data.json
Start ECS agent again as explained here - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html


To make sure it uses correct cluster, check logs - docker logs ecs-agent. It should have a message like:

[INFO] Registration completed successfully. I am running as 'arn:aws:ecs:eu-west-1:ACCOUNT_ID:container-instance/CLUSTER_ID' in cluster 'devcluster'