From f9db6433cd6e71400a830c25449370903cf54d22 Mon Sep 17 00:00:00 2001 From: David Valdez Date: Tue, 28 Aug 2018 17:15:47 -0500 Subject: [PATCH] Files migration --- .../agaric_migration/migrations/agaric.yml | 2 +- .../migrations/agaric_files.yml | 45 +++++++++++++++++++ .../{agaric_pages.yml => agaric_page.yml} | 0 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 web/modules/custom/agaric_migration/migrations/agaric_files.yml rename web/modules/custom/agaric_migration/migrations/{agaric_pages.yml => agaric_page.yml} (100%) diff --git a/web/modules/custom/agaric_migration/migrations/agaric.yml b/web/modules/custom/agaric_migration/migrations/agaric.yml index e862892..a57bf8e 100644 --- a/web/modules/custom/agaric_migration/migrations/agaric.yml +++ b/web/modules/custom/agaric_migration/migrations/agaric.yml @@ -8,4 +8,4 @@ shared_configuration: dependencies: enforced: module: - - agaric_migration + - agaric_migration diff --git a/web/modules/custom/agaric_migration/migrations/agaric_files.yml b/web/modules/custom/agaric_migration/migrations/agaric_files.yml new file mode 100644 index 0000000..40bfeb0 --- /dev/null +++ b/web/modules/custom/agaric_migration/migrations/agaric_files.yml @@ -0,0 +1,45 @@ +id: agaric_file +migration_group: agaric +label: Public files +source: + plugin: d7_file + scheme: public +process: + filename: filename + source_full_path: + - + plugin: concat + delimiter: / + source: + - filepath + - + plugin: str_replace + search: 'sites/default/files/' + # The old files must be located at this path: + replace: 'sites/default/import/' + - + plugin: urlencode + uri: + plugin: file_copy + source: + - '@source_full_path' + - uri + filemime: filemime + status: status + created: timestamp + changed: timestamp + uid: + - + plugin: migration_lookup + migration: agaric_user + source: uid + no_stub: true + - + # If the user id does not exists then migrate it as anonymous. + plugin: default_value + default_value: 0 +destination: + plugin: entity:file +migration_dependencies: + required: + - nichq_community_user diff --git a/web/modules/custom/agaric_migration/migrations/agaric_pages.yml b/web/modules/custom/agaric_migration/migrations/agaric_page.yml similarity index 100% rename from web/modules/custom/agaric_migration/migrations/agaric_pages.yml rename to web/modules/custom/agaric_migration/migrations/agaric_page.yml