Stop the algorand service
sudo systemctl stop algorand
cd /var/lib/algorand/genesis/mainnet
sudo cp genesis.json /var/lib/algorand/
Start the node to make sure you're already switched in mainnet.
sudo systemctl start algorand
Check your node after start the service.
goal node status -d /var/lib/algorand
Here is the result if you're already set up to testnet.