Steps to reproduce:
Private geth network is running on server1.
Deploy contract using truffle and make a few transactions.
Stop geth n/w of server1 and copy its entire directory (accounts.txt, boot.key, genesis.json, node's password.txt along with its directories keystore and geth) and paste to server2
Change in the geth configuration --rpcaddr 'xx.xx.xx.xx' with private IP of the server2.
Bring up this geth network clone of server1 on server2 (it is able to successfully seal new block, mine potential block, and commit new mining work)
Interact with contract on server2.
Error: contract not deployed
- Restart the stopped geth n/w on server1 (it is able to successfully seal new block, mine potential block, and commit new mining work)
Interact with contract on server1.
Error: contract not deployed.
Expectation: Restarting the geth n/w on server1 should not cause any data loss and should be able to interact(get the transactions performed on server1 as the data should be present in chaindata) with the contract on server2.
Note: I was able to migrate a test geth n/w successfully for a n/w running from past 2 days. After this successful operation, I was migrating this geth n/w which was running from past 7 months which is failing now with error contract not deployed. Will it sync/heal itself if its up for a long time? What are the correct ways to restart and migrate the n/w with huge chaindata.