First, upgrade the master on the server.
You can upgrade the client at any time, irrespective of whether the server is upgraded or not.