Fastest way of Migrating your Dapps to Mumbai/Goerli Test-net

Fastest way of Migrating your Dapps to Mumbai/Goerli Test-net

Now its time to say Good Bye πŸ‘‹ to our good old friend Ropsten-Rinkeby. It is very important to shift your previous dapp to a new testnet in order to shill your projects in future .

This will be the fastest way of migrating your previous projects or dapps on the Mumbai or Goerli network. So without wasting any time , let me show you how you can do that :

Steps to follow :

image.png

  • Move into the contract folder of your dapp

image.png

  • Open your contracts folder in vs-code/yourFavTextEditor and copy all the content of the Contract.sol file.

image.png

  • Now open Remix IDE and create new file by clicking here. Name it anything you want and paste all the content of the Contract.sol file.

  • After pasting all the content type CTRL + S for compiling the contract.

image.png

  • After hitting CTRL+S you will see a green tick like this . If not then copy paste your contract again until a green tick appears like this. If it is appearing then you are good to go.

image.png

  • Now its time to click on the Deploy and Run Transactions tab . (yellow)

  • Now click on the drop down menu and select the Injected Provider - Metamask option .

  • Now metamask will popup and you will have to change your network on the polygon testnet or goerli testnet according to your preference .

image.png

  • Now click on the DEPLOY button . Provide any arguments if it asks for any. In my case there is no argument .

(Make sure you are deploying the right contract πŸ†—)

image.png

  • After clicking deploy , the metamask will popup , just confirm the transactionπŸ‘†. After confirming you will scroll down and will see your contract is deployed πŸ‘‡.

image.png

  • Click as shown in the image to copy your contract address and move back into your frontend files and update the contract address as shown .

PROBABILITY : Usually contract address and contract ABI is stored in the Constants folder's index.js or constants.js file .

image.png

Congratulations πŸ₯³πŸŽ‰πŸŽ‰ Your dapp is now shifted to the polygon/goerli network.

Additional things you can do .

Some of the additional things that you can do is change your hardhat.config file , So if someone wants to use your dapp in future , he can do that as well.

For that you have to change 2 things

  • Network : Change your network to goerli or mumbai

  • RPC Url : Change the RPC URL to https://rpc.ankr.com/eth_goerli for Goerli network or https://rpc.ankr.com/polygon_mumbai for the polygon's mumbai network.

In my case I am deploying it to the polygon network so I will use the polygon RPC url.

image.png

And that's it for this blog . Do share it with the fellow developers . πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Β