Yeah, thanks @mstenta! Now with that fix merged in we can pull the latest docker image and re-run without the manual patching;
$ docker pull farmos/farmos:2.x-dev
2.x-dev: Pulling from farmos/farmos
45b42c59be33: Already exists
...
c4cd65145065: Pull complete
Digest: sha256:bc4a80515cec6f368b2cf602ec3fdcad99e605620446fae2925594fc1d957505
Status: Downloaded newer image for farmos/farmos:2.x-dev
docker.io/farmos/farmos:2.x-dev
www2:
depends_on:
- db2
image: farmos/farmos:2.x-dev
entrypoint: /bin/bash
command:
- -c
- |
set -ex
wait_db_ready() {
...
- cp /opt/testing_patched/Quantity.php /opt/drupal/web/profiles/farm/modules/core/migrate/src/Plugin/migrate/source/d7/Quantity.php
- chown www-data:www-data /opt/drupal/web/profiles/farm/modules/core/migrate/src/Plugin/migrate/source/d7/Quantity.php
fi
wait_db_ready
...
volumes:
- './www2:/opt/drupal'
- './php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini'
- './sites/default/files:/opt/farmOS_1x_files:ro'
- - '../../farmOS/modules/core/migrate/src/Plugin/migrate/source/d7/Quantity.php:/opt/testing_patched/Quantity.php:ro'
expose:
- '80'
environment:
XDEBUG_MODE: debug
Clean re-run;
$ docker-compose stop db2 www2 && docker-compose rm -f db2 www2 && sudo rm -rf db2 www2
$ docker-compose up -d
$ docker-compose logs --follow --no-log-prefix www2
Attaching to devel_www2_1
+ '[' -d /opt/drupal ']'
++ ls -A /opt/drupal/composer.json
ls: cannot access '/opt/drupal/composer.json': No such file or directory
farmOS codebase not detected. Copying from pre-built files in the Docker image.
+ '[' '' ']'
+ echo 'farmOS codebase not detected. Copying from pre-built files in the Docker image.'
+ cp -rp /var/farmOS/. /opt/drupal
+ wait_db_ready
+ su www-data -s /bin/bash -c 'drush site-install farm --locale=en --db-url=pgsql://farm:farm@db2/farm --site-name=Test0 --account-name=root --account-pass=test'
You are about to:
* Create a sites/default/settings.php file
* DROP all tables in your 'farm' database.
Do you want to continue? (yes/no) [yes]:
[notice] Starting Drupal installation. This takes a while.
[notice] Performed install task: install_select_language
[notice] Performed install task: install_select_profile
[notice] Performed install task: install_load_profile
[notice] Performed install task: install_verify_requirements
[notice] Performed install task: install_settings_form
[notice] Performed install task: install_verify_database_ready
[notice] Performed install task: install_base_system
[notice] Performed install task: install_bootstrap_full
[notice] Performed install task: install_profile_modules
[notice] Performed install task: install_profile_themes
[notice] Performed install task: install_install_profile
[notice] Performed install task: install_configure_form
[notice] Performed install task: \Drupal\farm\Form\FarmModulesForm
[warning] is_dir(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? FileSystem.php:523
[warning] is_dir(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? FileSystem.php:523
[notice] entity_reference_integrity_enforce.settings rewritten by farm_entity
[notice] simple_oauth.settings rewritten by farm_api
[notice] jsonapi.settings rewritten by farm_api
[notice] jsonapi_extras.settings rewritten by farm_api
[notice] gin.settings rewritten by farm_ui_theme
[notice] Performed install task: farm_install_modules
[notice] Cron run completed.
[notice] Performed install task: install_finished
[success] Installation complete.
+ echo '
$databases['\''migrate'\'']['\''default'\''] = [
'\''database'\'' => '\''farm'\'',
'\''username'\'' => '\''farm'\'',
'\''password'\'' => '\''farm'\'',
'\''prefix'\'' => '\'''\'',
'\''host'\'' => '\''db'\'',
'\''port'\'' => '\''3306'\'',
'\''namespace'\'' => '\''Drupal\Core\Database\Driver\mysql'\'',
'\''driver'\'' => '\''mysql'\'',
];
'
+ cp -r /opt/farmOS_1x_files /opt/drupal/web/sites/default/files/migrate
+ chown -R www-data:www-data /opt/drupal/web/sites/default/files/migrate
+ wait_db_ready
+ su www-data -s /bin/bash
+ drush --root=/opt/drupal pm-enable --yes farm_migrate
> The following module(s) will be enabled: farm_migrate, migrate, migrate_drupal, migrate_plus, migrate_tools
// Do you want to continue?: yes.
[success] Successfully enabled: farm_migrate, migrate, migrate_drupal, migrate_plus, migrate_tools
+ drush --root=/opt/drupal migrate:import --group=farm_migrate
1/1 [============================] 100% [notice] Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_system_date'
7/7 [============================] 100% [notice] Processed 7 items (7 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_user'
728/728 [============================] 100% [notice] Processed 728 items (728 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_file'
[notice] Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_file_private'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_taxonomy
8/8 [============================] 100% [notice] Processed 8 items (8 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_animal_type'
[notice] Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_crop_family'
372/372 [============================] 100% [notice] Processed 372 items (372 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_plant_type'
57/57 [============================] 100% [notice] Processed 57 items (57 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_season'
8/8 [============================] 100% [notice] Processed 8 items (8 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_log_category'
5/5 [============================] 100% [notice] Processed 5 items (5 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_unit'
1/1 [============================] 100% [notice] Processed 1 item (1 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_taxonomy_material'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_asset
67/67 [============================] 100% [notice] Processed 67 items (67 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_asset_animal'
2/2 [============================] 100% [notice] Processed 2 items (2 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_asset_equipment'
372/372 [============================] 100% [notice] Processed 372 items (372 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_asset_plant'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_area
179/179 [============================] 100% [notice] Processed 179 items (179 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_area_land'
171/171 [============================] 100% [notice] Processed 171 items (171 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_area_none'
2/2 [============================] 100% [notice] Processed 2 items (2 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_area_structure'
[notice] Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_area_water'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_quantity
427/427 [============================] 100% [notice] Processed 427 items (427 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_quantity'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_log
414/414 [============================] 100% [notice] Processed 414 items (414 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_activity'
72/72 [============================] 100% [notice] Processed 72 items (72 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_harvest'
2/2 [============================] 100% [notice] Processed 2 items (2 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_input'
[notice] Processed 0 items (0 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_maintenance'
7015/7015 [============================] 100% [notice] Processed 7015 items (7015 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_observation'
349/349 [============================] 100% [notice] Processed 349 items (349 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_log_seeding'
+ drush --root=/opt/drupal migrate:import --group=farm_migrate_reference
352/352 [============================] 100% [notice] Processed 352 items (352 created, 0 updated, 0 failed, 0 ignored) - done with 'farm_migrate_area_field_parent'
435/2945 [====>-----------------------] 14% [notice] Processed 2945 items (441 created, 0 updated, 0 failed, 2504 ignored) - done with 'farm_migrate_asset_field_parent'
+ exec docker-entrypoint.sh apache2-foreground
Attempting: apache2-foreground
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.14. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.14. Set the 'ServerName' directive globally to suppress this message
[Sun Feb 14 20:44:02.377157 2021] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.4.15 configured -- resuming normal operations
[Sun Feb 14 20:44:02.377182 2021] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
Of interest here is the 2504 ignored items from the farm_migrate_asset_field_parent
migration;
[notice] Processed 2945 items (441 created, 0 updated, 0 failed, 2504 ignored) - done with ‘farm_migrate_asset_field_parent’
That’s right in the same ballpark as the number of seed assets I have - which aren’t expected to be migrating yet since I haven’t written a 2.x seed module…
So my current status is now as follows;
- Almost everything migrated
- Need to look into scripting some sort of parity mechanism to validate what data is missing
- Need to port custom stuff to farmOS 2.x and write migration logic for that