{"id":18262800,"url":"https://github.com/roblib/scripts","last_synced_at":"2025-08-12T02:41:09.052Z","repository":{"id":4345179,"uuid":"5481126","full_name":"roblib/scripts","owner":"roblib","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-25T14:26:51.000Z","size":137,"stargazers_count":4,"open_issues_count":0,"forks_count":6,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-20T18:11:12.332Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roblib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-20T12:50:47.000Z","updated_at":"2019-01-22T20:33:39.000Z","dependencies_parsed_at":"2022-08-06T16:15:20.079Z","dependency_job_id":null,"html_url":"https://github.com/roblib/scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fscripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fscripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fscripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roblib%2Fscripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roblib","download_url":"https://codeload.github.com/roblib/scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247246173,"owners_count":20907748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:08:49.737Z","updated_at":"2025-04-04T20:30:52.522Z","avatar_url":"https://github.com/roblib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"scripts\n=======\nRepo for various robertson library scripts.  \n\nCurrently the drush scripts are being migrated to use tuque.  Any scripts that have been updated have been moved to the drupal7 folder.  Ideally only one version the scripts should be installed on a server as there maybe conflicts if both versions exist on the same server.\n\nSetup\n-----\nTo make the Drush commands accessible to Drush, make a shortcut to them in the .drush directory in your home directory, e.g., \n\n```bash\n# If this repository is located in ~/dev/scripts.\nmkdir ~/.drush\nln -s ~/scripts/drush/drupal7 ~/.drush/islandora\n# Force drush to reload its list of commands\ndrush cc drush\n```\n\nData Migration Drush Commands\n-----------------------------\n\nIn order to migrate content between repositories that is protected by XACML POLICY streams you can now use the 'islandora-export-objects' and 'islandora-import-objects'.\n\nAn example export / import workflow would look like:\n\nOn the computer hosting the source repository:\n\n```bash\n# Go to the site directory of the Drupal site that has Islandora pointed to the source repository\ncd /var/www/html/drupal/sites/default/\n\n# Given a list of PIDs in a file called pids.txt\ndrush --user=1 islandora-export-objects --pids-file-dir=/home/yourhome/export --pids-filename=pids.txt  --include-datastreams=TRUE\n```\n\n\"--include-datastreams\" will export the profile data and file objects of all of the exported objects' datastreams. \n\nThe output of exporting the datastreams will look like this:\n\n```bash\nbdh_4805      \n - TN.profile.json\n - DC.profile.json\n - RELS-INT.profile.json\n - RELS-INT\n - POLICY.profile.json\n - TN\n - MODS\n - RELS-EXT\n - JP2.profile.json\n - MODS.profile.json\n - RELS-EXT.profile.json\n - OBJ\n - JPG.profile.json\n - TECHMD\n - JPG\n - OBJ.profile.json\n - POLICY\n - JP2\n - TECHMD.profile.json\n - DC\nbdh_4805.json \nbdh_4805.xml  \n```\n\nMove the files to the destination host and then run the following to import:\n\n```bash\ndrush --user=1 islandora-import-objects --foxml-files-dir=/home/userdir/export --foxml-files-list=/home/userdir/export/bdh_remaining_files.txt --use-exported-datastreams=TRUE\n```\n\n## migrate.py Import and export in one step\n\n### Set up drush site aliases\n\nThe migrate.py command takes advantage of Drush's [site aliases](https://www.drupal.org/node/1401522) to save you typing the same options for source and destinatinon connection over and over again.\n\nmigrate.py assumes that the 'source' Islandora site is a remote connection and the destination Islandora site is accessible locally.\n\nSo your ~/.drush/aliases.drushrc.php file would look something like this:\n\n```php\n\u003c?php\n/**\n * Development alias\n * Set up each entry to suit your site configuration\n */\n$aliases['prod'] = array (\n  'uri' =\u003e 'www.yourislandorasite.ca',\n  'root' =\u003e '/var/www/html/drupal',\n  'remote-user' =\u003e 'sshuser',\n  'remote-host' =\u003e 'yourislandorasite.ca',\n);\n$aliases['local'] = array(\n  'url' =\u003e 'local.test',\n  'root' =\u003e '/Users/myuser/Sites/drupal',\n);\n```\n\nAnd an example migrate commadn would look like this:\n\n```bash\npython3 migrate.py -a @prod -d @local -s yourislandorasite.ca -u sshuser --pids=example:1,example:2,example:3 --verbose\n```\n\nThe python script is not parsing the drush aliases, just passing them directly to drush, hence the need to supply the source ssh address on the command line for now.\n\nmigrate.py is a wrapper for the drush commands islandora-export-objects and islandora-import-objects which have their own documentation in this repository's main README.md.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblib%2Fscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froblib%2Fscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froblib%2Fscripts/lists"}