This repository uses the OSF API (Open Science Framework) to gather a list of preprints and converts them to a XML format acceptable by the PKP OPS (Open Preprint Systems) Native Import/Export Plugin.
- The authors will be imported as users, thus, they will be able to access their submissions once they "recover" their accounts (the OPS administrator will have to help), if this isn't desirable, avoid the item 6 and review the file on the item 7, to setup the right owner username.
- As retrieving the user email isn't provided by the API (which is great), the code will import the users using a fake email. The email pattern can be configured through an argument.
- This was built for OPS 3.4.0, future versions might introduce breaking changes.
-
Ensure all OPS data is backed up!
-
Register at http://osf.io and grab an authorization token (https://developer.osf.io/#tag/Authentication) to make API requests.
-
Go to the administration interface, enable and setup the DOI and ORCID plugins at the
Website > Plugins
-
At the
Workflow > Metadata
, enable the:Keywords
,Rights
,Disciplines
andPublisher ID
. -
At the root of this repository, run the command bellow to get more information about the usage, then execute it to produce the import data
php src/import.php -h
Here's a sample command to import preprints:
php import.php -c OPS_SERVER_NAME -p OSF_PREPRINT_PROVIDER_NAME -d -o output -b https://OPS_BASE_INSTALLATION_URL.org/index.php/OPS_SERVER_NAME/preprint/view -t OSF_API_TOKEN
-
After executing the
import.php
, go to the output folder (specified by the-o
argument) and execute the fileusers.sql
in your MySQL console -
Execute the file
import.sh
to import the XMLs -
Execute the files
downloads.sql
andassignments.sql
-
Execute the file
redirects.sql
, it will output redirect (from http://osf.io to the OPS pattern) statements for Apache