Changing the primary domain name on a Google Apps account is a non-trivial process. I recently needed to do this for a customer, and created a console application that makes the job easier.
This works on OS X and Linux; Windows support is unknown (and will not be tested by me). It’s written in Go, so you will need to have a Go development environment set up to build or run it.
Clone the GitHub project:
git clone https://github.com/dougreese/ga-change-primary-domain.git
then follow the instructions in the README to build and run.
Some additional resources:
- Before you change your primary domain
- Short video that uses the APIs Explorer to change the primary domain
- Google APIs Developer console – to set up a project and download your client_secret.json data
- Google Directory API Go Quickstart
- Documentation for API Go package