If your purpose for processing personal data changes over time (or if you want to process data for a new purpose), you can only do this if:
the new purpose is compatible with your original purpose (eg because the processing is for archiving purposes in the public interest or because there is a clear connection between your original purpose and your new purpose)
you obtain the data subjects’ specific consent for the new purpose, or
you have a clear legal basis requiring (or allowing) the new processing in the public interest (eg if the new processing is for a public authority function)
For more information, read Data protection principles.