Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset command #9

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .ddev/commands/host/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

# Identify the DB files to import
# Provide aruuments to the script if you want ot import specific files.
dump_drupal="${1:-$(ls .dbdumps/ch24005_drupal_vorschau_*.sql | tail -n1)}"
dump_typo3="${2:-$(ls .dbdumps/ch24005_swiss_artg_*.sql | tail -n1)}"

# Import database dumps
# Examples:
# ddev import-db -f .dbdumps/ch24005_drupal_vorschau_2024-12-07T2024-1934.sql
# ddev import-db -d typo3 -f .dbdumps/ch24005_swiss_artg_20201030_2024-12-07T2024-1329.sql
if [ -f "${dump_drupal}" ]; then
ddev import-db -f "${dump_drupal}"
else
echo -e '\033[41mERROR:\033[0m No Drupal database dump file found' >&2
echo 'Run `ddev fetch-db` first' >&2
exit 1
fi

if [ -f "${dump_typo3}" ]; then
ddev import-db -d typo3 -f "${dump_typo3}"
else
echo -e '\033[0;30m\033[43mWARNING:\033[0m No Typo3 database dump file found' >&2
echo 'Run `ddev fetch-db ch24005_swiss_artg_20201030` first if you want to run content migrations' >&2
fi

# Install dependencies
ddev composer install

# Load and update configuration
ddev drush cim -y
ddev drush locale:update

# Clear cache and reset admin password
ddev drush cr
ddev drush upwd admin admin
23 changes: 7 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,23 @@ Changes to the site must be done in the local development environment first and
ddev start
```

4. Install the dependencies

```sh
ddev composer install
```

5. Fetch content from the hosting
4. Fetch content from the hosting

```sh
ddev fetch-db
ddev import-db -f .dbdump/<dumpfile>
ddev fetch-files
```

`fetch-db` creates a new database dump file in `.dbdump`.
Check the content of that directory for available dump files.
Use an appropriate one for `<dumpfile>` in the command shown above.

6. Reset cache config and admin password
6. Reset local environment

```sh
ddev drush cim -y
ddev drush cr
ddev drush upwd admin admin
ddev reset
```

Doing a full reset all the time, can be a bit over the top and time consuming.
Check out the contents of `.ddev/commands/host/reset` to set what that command is doing.
Run indivudall commands as you seem fit in your development workflow.

7. Access the site

```sh
Expand Down
2 changes: 1 addition & 1 deletion config/default/migrate_plus.migration.news.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: default
label: 'News-Migration'
label: News-Migration
source:
plugin: news
process:
Expand Down
2 changes: 1 addition & 1 deletion config/default/node.type.news_migrated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ third_party_settings:
menu_ui:
available_menus: { }
parent: ''
name: Migrierte News
name: 'Migrierte News'
type: news_migrated
description: 'Von Typo3 migrierte News'
help: null
Expand Down
Loading