Moving existing Piwik install to new domain name

I want to move one of my Piwik installs to a different subdomain.

Would updating the domain name in the database and/or config files, plus updating the domain in the tracking codes that have already been deployed, work for this switch?

Or could I set up a fresh install on the new location, then export the database (or the sites individually) from the old one and import it into the new one?

See: Installation - Analytics Platform - Matomo

Ha… I was looking for the topic in the How-To section instead… thanks!