迁移仓库后Datacite重新注册DOI重定向失败,寻求解决方法
I’ve run into similar issues updating DataCite DOIs for repository migrations—let’s walk through the most common fixes and troubleshooting steps to get your redirect working:
1. Confirm Environment & Authentication Are Correct
First, eliminate the basics:
- Environment mismatch: Test DOIs use
https://mds.test.datacite.org, while production DOIs requirehttps://mds.datacite.org. Using the wrong endpoint for your DOI will result in silent failures or 404 errors. - Permission issues: Ensure your username/password has edit access to the DOI. If you’re not the registered owner or haven’t been granted permissions, you’ll get a
403 Forbiddenresponse. Add the-vflag to your curl command to see explicit status codes and error details:curl -v -H "Content-Type:text/plain;charset=UTF-8" -X PUT --user your-username:your-password -d "$(printf 'doi=10.YOUR-DOI/PREFIX\nurl=https://your-new-repo.com')" https://mds.datacite.org/doi/10.YOUR-DOI/PREFIX
2. Fix Request Body Formatting
DataCite’s MDS API is strict about the request body structure—small formatting errors break the update:
- Use LF newlines (not CRLF, common on Windows) between
doi=andurl=. Theprintfcommand should handle this, but avoid hardcoding\r\nif you’re writing the string manually. - Don’t add unnecessary trailing slashes to the URL unless your new repository requires them.
- Ensure no extra spaces before/after
doi=orurl=.
Here’s a cleaned-up, reliable command example:
curl -H "Content-Type:text/plain;charset=UTF-8" -X PUT --user your-username:your-password -d "$(printf 'doi=10.5072/JQX3-61AT\nurl=https://your-new-repo-url.com')" https://mds.test.datacite.org/doi/10.5072/JQX3-61AT
3. Switch to DataCite’s REST API (More Reliable)
If the MDS API isn’t cooperating, the newer REST API (v3) provides clearer error messages and more consistent behavior. Use this command instead:
curl -X PUT -H "Content-Type: application/vnd.api+json" -H "Authorization: Basic $(echo -n 'your-username:your-password' | base64)" -d '{ "data": { "type": "dois", "id": "10.5072/JQX3-61AT", "attributes": { "url": "https://your-new-repo-url.com" } } }' https://api.datacite.org/dois/10.5072/JQX3-61AT
For production DOIs, keep the api.datacite.org endpoint (it maps to the production environment).
4. Verify the DOI’s Current State
Before troubleshooting further, confirm you can retrieve the DOI’s existing metadata with a GET request:
curl --user your-username:your-password https://mds.datacite.org/doi/10.5072/JQX3-61AT
If this returns a 404, the DOI isn’t registered under your account, or you’re using the wrong environment.
5. Contact DataCite Support as a Last Resort
If none of the above steps work, gather these details and reach out to DataCite support:
- Your full, redacted curl command (hide credentials)
- Verbose output from the
-vflag - Your DOI and account registration details
They can check if the DOI is locked, has backend permission issues, or if there’s a system-wide problem affecting your update.
内容的提问来源于stack exchange,提问作者jschnasse

