-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix drush commands in cleanup doc #70
base: main
Are you sure you want to change the base?
Conversation
``` | ||
|
||
3. Re-index Solr | ||
|
||
```bash | ||
drush --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index | ||
drush --user=1 --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So Drush itself removed the --user
option to apply globally on commands via drush-ops/drush#3396.
It was re-implemented by dgi as user context can be important in some of the commands that are ran by https://github.com/discoverygarden/islandora_drush_utils/blob/318d245d1b01cf08ff2a9249418b4ebecc3799cb/src/Drush/CommandInfoAlterers/UserWrappingAlterer.php and https://github.com/discoverygarden/islandora_drush_utils/blob/318d245d1b01cf08ff2a9249418b4ebecc3799cb/src/Drush/Commands/UserWrapperCommands.php.
The commands that leverage it are annotated like https://github.com/discoverygarden/islandora_drush_utils/blob/318d245d1b01cf08ff2a9249418b4ebecc3799cb/src/Drush/Commands/Deleter.php#L170 in older Drush syntax and https://github.com/discoverygarden/dgi_standard_derivative_examiner/blob/2ee5f0ce51fe57f31211c5d52106a4f1b0f74144/src/Drush/Commands/DerivativeCommands.php#L64 on new Drush syntax.
@@ -119,12 +119,12 @@ The `migration` config_split disables the tracking of content changes. | |||
|
|||
First rebuild the snapshot table. | |||
```bash | |||
drush --uri=$DRUSH_OPTIONS_URI drush cs:s | |||
drush --user=1 --uri=$DRUSH_OPTIONS_URI cs:s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 --uri=$DRUSH_OPTIONS_URI cs:s | |
drush --uri=$DRUSH_OPTIONS_URI cs:s --user=1 |
Since --user
isn't global needs to be on the end of the command but correct in that it is missing here.
@@ -105,7 +105,7 @@ drush --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index | |||
|
|||
4. Rebuild the OAI-PMH cache | |||
```bash | |||
drush --uri=$DRUSH_OPTIONS_URI idr:roai | |||
drush --user=1 --uri=$DRUSH_OPTIONS_URI idr:roai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 --uri=$DRUSH_OPTIONS_URI idr:roai | |
drush --uri=$DRUSH_OPTIONS_URI idr:roai |
This command doesn't support --user
. Reasoning here is that OAI entries should only be generated with the anonymous user context given you would not want potentially locked down entries to show as available for harvest.
``` | ||
|
||
3. Re-index Solr | ||
|
||
```bash | ||
drush --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index | ||
drush --user=1 --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index | |
drush --uri=$DRUSH_OPTIONS_URI search-api:index default_solr_index |
drush --uri=$DRUSH_OPTIONS_URI dmrpa:empa --user=1 | ||
``` | ||
|
||
Once it's complete disable the module. | ||
```bash | ||
drush pm:uninstall dgi_migrate_regenerate_pathauto_aliases | ||
drush --user=1 pm:uninstall dgi_migrate_regenerate_pathauto_aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 pm:uninstall dgi_migrate_regenerate_pathauto_aliases | |
drush pm:uninstall dgi_migrate_regenerate_pathauto_aliases |
``` | ||
|
||
2. Generate missing path aliases | ||
|
||
Enable the `dgi_migrate_regenerate_pathauto_aliases` module and kick off the | ||
generation. | ||
```bash | ||
drush en dgi_migrate_regenerate_pathauto_aliases | ||
drush --user=1 en dgi_migrate_regenerate_pathauto_aliases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 en dgi_migrate_regenerate_pathauto_aliases | |
drush en dgi_migrate_regenerate_pathauto_aliases |
@@ -76,27 +76,27 @@ Once this is disabled `content_sync`, path aliases, immediate Solr indexing and | |||
OAI-PMH harvesting will be enabled. | |||
|
|||
``` | |||
drush config-split:deactivate migration | |||
drush --user=1 config-split:deactivate migration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 config-split:deactivate migration | |
drush config-split:deactivate migration |
``` | ||
|
||
Export all the content. | ||
```bash | ||
drush --uri=$DRUSH_OPTIONS_URI content-sync:export --user=1 sync --files=none --entity-types=node | ||
drush --user=1 --uri=$DRUSH_OPTIONS_URI content-sync:export --user=1 sync --files=none --entity-types=node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drush --user=1 --uri=$DRUSH_OPTIONS_URI content-sync:export --user=1 sync --files=none --entity-types=node | |
drush --uri=$DRUSH_OPTIONS_URI content-sync:export --user=1 sync --files=none --entity-types=node |
Passed already.
Adds
--user=1
to the drush commands, and removes an extradrush
from one of the commands.