DOI is like a handle or a persistent URL but with “glam”.
It’s goal is just the one you described… get an ID/url that could redirect to a different url if the content change it’s ubication.
To do this with OJS you only need to reRegister your DOI to your agency (ie: CrossRef).
First be sure your OJS is now configured to assign the right DOIs.
After this, it’s time to reRegister your article’s DOI.
You can do it manually (upload an xml file to crossref) of you can let OJS do it in your behalf.
Detailed explanation here: https://docs.pkp.sfu.ca/doi-plugin/en/doi-registration
Not sure with other agecies but with CrossRef the update take less than a minute.