First, as per that initialization of the two instances shown in your code, both are cluster members belonging to the same cluster group and, given the default configuration, they will both contain all of the shared data. In other words, you wouldn't need to 'transfer' information.
If the above is true, by the time you're done deleting from the first instance, you won't have any copy of the data (other than their respective source).
If, however, the instances are initialized with configurations tying them to different cluster groups (remember, your code in the question isn't doing so), it's easy enough to just 'copy' using the Java Map/Collections API (which Hazelcast shared data structure types implement):
secondInstance.getMap("myMap").putAll(firstInstance.getMap("myMap"));
firstInstance.getMap("myMap").clear(); //please confirm this.
Distributed lists can be treated in a similar manner.
Also, be careful with such 'bulk copies' as your member can hit an out of memory error (of course, that depends on the size of your data).
More about this can be read here: http://docs.hazelcast.org/docs/3.6/manual/html-single/index.html#preventing-out-of-memory-exceptions
newHazelcastInstance()
. The idea is to get the updated data and save it in the secondInstace whilst the firstInstance is being used by other services. Once the secondInstance is updated, I wanted to remove all data from the firstInstace and load it from the secondInstance. – Warp