4

I have deployed one contract in my private blockchain, now client has asked some modification to existing contract and after changes we redeployed this into ethereum network and I got new contract address. Now can we migrate some data from previous contract address to newly deployed contract.

Thanks

2

You can. If you have provided the ability for such a migration. Some addOldData(...) method. Or if there is no migration method, then, may be, you can repeat all requests - same as to previous contract. Or, may be in old contract you have getData() method - then you can call it from new contract or from application level.

If no options above are not available for you, then create a new contract with these methods and deploy it again.

In a worst case, if you have much of data in old contract and no methods to gain the data - you still can obtain them by other means - tools (libs) for blockchain analisys. All the contract's data are public, so it should be possible.

0

of course you can, just transfer the data from your previous contract to your new contract by using defined methods.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.