Scrape off the old wax ring from the flange, toilet base, and floor using a putty knife. Inspect the flange for cracks, rust, ...
Plumbing codes vary between residential and commercial installations and are generally adopted at the state or local level.