Skip to content

Instantly share code, notes, and snippets.

View rakeshjames's full-sized avatar
💤

Rakesh James rakeshjames

💤
View GitHub Profile
# If you come from bash you might have to change your $PATH.
export PATH=/usr/local/Cellar/[email protected]/9.6.10/bin:$PATH
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="$PATH:$HOME/.composer/vendor/bin"
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
id: migrate_csv_vocabulary
label: 'Migrate vocabulary from the csv file'
migration_group: migration_csv_custom
source:
plugin: csv
path: 'modules/custom/migrate_csv/assets/csv/vocabulary.csv'
header_row_count: 1
keys:
- Title
process:
ID Title Description
1 Food Add food related to terms to this vocabulary.
2 USA Add USA related to terms to this vocabulary.
3 Life Style Add Life Style related to terms to this vocabulary.
4 WAR Add WAR related to terms to this vocabulary.
5 Politics Add Politics related to terms to this vocabulary.
6 Sports Add Sports related to terms to this vocabulary.
id: migrate_csv_tags
label: 'Migrate Tags from the csv file'
migration_group: migration_csv_custom
source:
plugin: csv
path: 'modules/custom/migrate_csv/assets/csv/tags.csv'
header_row_count: 1
keys:
- Title
process:
Title
Fruit
Movies
Sports
News
Animals
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
ID,Title,Body,Picture,Tags,Author
1,Orange,"The orange is the fruit of the citrus species Citrus × sinensis in the family Rutaceae.[1] It is also called sweet orange, to distinguish it from the related Citrus × aurantium, referred to as bitter orange. The sweet orange reproduces asexually (apomixis through nucellar embryony); varieties of sweet orange arise through mutations.[2]
The orange is a hybrid between pomelo (Citrus maxima) and mandarin (Citrus reticulata).[2][3] The chloroplast genome, and therefore the maternal line, is that of pomelo.[4] The sweet orange has had its full genome sequenced.[2]
Sweet oranges were mentioned in Chinese literature in 314 BC.[2] As of 1987, orange trees were found to be the most cultivated fruit tree in the world.[5] Orange trees are widely grown in tropical and subtropical climates for their sweet fruit. The fruit of the orange tree can be eaten fresh, or processed for its juice or fragrant peel.[6] As of 2012, sweet oranges accounted for approximately 70% of citrus pr
dependencies:
module:
- file
id: migrate_csv_articles_images
label: 'Migrate Images for the articles from the csv file'
migration_group: null
source:
constants:
source_base_path: '/Library/WebServer/Documents/drupal/modules/custom/migrate_csv/assets/pictures'
uri_file: 'public://images/pictures/'
id: migrate_csv_articles
label: 'Migrate articles from the csv file'
source:
plugin: csv
# Full path to the file.
path: 'modules/custom/migrate_csv/assets/csv/articles.csv'
delimiter: ','
enclosure: '"'
header_row_count: 1
keys:
ID Name Email Password First Name Last Name Roles
1 Joe [email protected] joe123 Joe B administrator
2 rakesh [email protected] 123rakesh Rakesh James authenticated,administrator
3 jack [email protected] jack Jack David editor
4 DD [email protected] dd@123 D D authenticated,administrator,editor
id: User_with_multiple_roles
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags: null
migration_group: null
label: 'User migration from CSV test'
source:
plugin: csv
path: /Users/rakeshjames/Sites/migrationdemo/csv/demouser_migrate_multipleRoles.csv