From fe62319b047e735d3b03a824559eb04ad53c08c0 Mon Sep 17 00:00:00 2001 From: Christian Haeusler <794584+corvus-ch@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:11:43 +0100 Subject: [PATCH 1/2] Update config format Do not fight config exporter formatting. --- config/default/migrate_plus.migration.news.yml | 2 +- config/default/node.type.news_migrated.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default/migrate_plus.migration.news.yml b/config/default/migrate_plus.migration.news.yml index cbee245..ecef00b 100644 --- a/config/default/migrate_plus.migration.news.yml +++ b/config/default/migrate_plus.migration.news.yml @@ -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: diff --git a/config/default/node.type.news_migrated.yml b/config/default/node.type.news_migrated.yml index c83701c..6ea4529 100644 --- a/config/default/node.type.news_migrated.yml +++ b/config/default/node.type.news_migrated.yml @@ -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 From 80cc9dd202d3b72c6f8537f2fdb5d9670bac302f Mon Sep 17 00:00:00 2001 From: Christian Haeusler <794584+corvus-ch@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:37:42 +0100 Subject: [PATCH 2/2] Reset command Added `ddev reset` for convenience. --- .ddev/commands/host/reset | 36 ++++++++++++++++++++++++++++++++++++ README.md | 23 +++++++---------------- 2 files changed, 43 insertions(+), 16 deletions(-) create mode 100755 .ddev/commands/host/reset diff --git a/.ddev/commands/host/reset b/.ddev/commands/host/reset new file mode 100755 index 0000000..de032c2 --- /dev/null +++ b/.ddev/commands/host/reset @@ -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 diff --git a/README.md b/README.md index f709988..0386e54 100644 --- a/README.md +++ b/README.md @@ -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/ 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 `` 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