Stopping xo-server before compiling shouldn't be necessary unless someone tries to use XO while it's building.
That said, I would recommend building the source under /usr/src or ~/src or something and then moving the files ( mv * ) to something like /opt/xen-orchestra-DATE (or git revision)
Then use "stow" to create symlinks in /usr/local, like this
stow -d /opt/ -t /usr/local xen-orchestra-DATE
The stow command is in the CentOS repository or can be downloaded and compiled separately from any GNU mirror.
Make sure the /etc/xo-server/ config points to the relevant symlinks in /usr/local and restart xo-server
This way you can keep a number of different XO versions available in /opt and if there's a problem with any one of them you simply run
stow -D -d /opt -t /usr/local xen-orchestra-BADVERSION
to delete the symlinks to the bad version and
stow -d /opt -t /usr/local xen-orchestra-GOODVERSION
to create links to the old, good one and then restart xo-server
When it's time to update the XO build go to the, now seemingly empty, source folder and run
git reset HEAD --hard
to repopulate the working directory and then
git pull && yarn && yarn build