MCNi Wiki : Importing Existing Data into a New Site
Created by Stephen Smith, last modified on Oct 23, 2018
- Export all necessary data files (mp3s, photos, etc.) to a single folder.
- Export your data to standardized CSVs. All fields must be present for all rows, but values do not have to be set.
- A sample views configuration for exporting from Drupal 6 is linked below.
- CSVs should contain fields as follows. They will be marked as required (must have a value), recommended (won't produce an error if blank, but should be set), or optional
| CSV name | Field Name | Data Type | Required? | Description |
| album.csv |
|
|
|
|
| title | string | required |
|
| body | string | optional | HTML (description) |
| file_thumbnail | string | optional | filename (album art. jpg or png) |
| release_date | string|int | optional | any standard date format or a timestamp |
| record_label | string | optional |
|
| other_credits | string | optional | HTML |
| purchase_1_url | string | optional | url |
| purchase_1_type | string|int | optional | 0 - Free download, 1 - paid download, 2 - physical purchase (default) |
| purchase_2_url | string | optional | url |
| purchase_2_type | string|int | optional | as above |
| ... | ... | .. | .. |
| purchase_10_url | string|int | optional | url |
| purchase_10_type | string|int | optional | as above |
| blog.csv |
|
|
|
|
| title | string | required |
|
| post_date | string|int | recommended | any standard date format or a timestamp |
| body | string | recommended | HTML (post content) |
| file_thumbnail | string | optional | filename (preview/thumbnail image. jpg or png) |
| fan_club_only | string | optional | "yes" or "no" |
| news.csv |
|
|
|
|
| title | string | required |
|
| post_date | string|int | recommended | any standard date format or a timestamp |
| body | string | recommended | HTML (post content) |
| file_thumbnail | string | optional | filename (preview/thumbnail image. jpg.png) |
| fan_club_only | string | optional | "yes" or "no" |
| photo.csv |
|
|
|
|
| image | string | required | filename (photo itself. jpg) |
| title | string | required |
|
| alt_text | string | optional | recommended for standards compliance |
| title_text | string | optional | recommended for standards compliance |
| fan_club_only | string | optional | "yes" or "no" |
| song.csv |
|
|
|
|
| title | string | required |
|
| mp3 | string | required | filename (most audio types, .mp3, .flac, .wav, .ogg, etc) |
| body | string | optional |
|
| file_thumbnail | string | optional | filename (album art. .jpg .png) |
| author | string | optional |
|
| studio | string | optional |
|
| file_tab | string | optional | filename (tablature. .pdf) |
| purchase_1_url | string | optional | url |
| purchase_1_type | string|int | optional | 0 - Free download, 1 - paid download, 2 - physical purchase (default) |
| ... | ... | ... | ... |
| purchase_10_url | string | optional | url |
| purchase_10_type | string|int | optional | as above |
| tour.csv |
|
|
|
|
| title | string | optional |
|
| tour_date | string|int | required | any standard date format or a timestamp |
| venue | string | required |
|
| shour | int | optional | 1...12 (show start hour) |
| smin | int | optional | 0,5,10...55 (show start minutes) |
| sampm | string | optional | "AM" or "PM" |
| ohour | int | optional | 1...12 (doors open hour) |
| omin | int | optional | 0,5,10...55 (doors open minutes) |
| oampm | string | optional | "AM" or "PM" |
| meet_greet_start | string|int | optional | any standard date format or a timestamp |
| meet_greet_stop | string|int | optional | any standard date format or a timestamp |
| body | string | optional | HTML |
| ticket_price | string | optional |
|
| age | string | optional | age restrictions |
| buy_tickets | string | optional | url |
| country | string | required | Full country name (e.g. "United States" or "Canada") |
| state | string | recommended | State abbreviatioon (e.g. "TN"). Required if country="United States" |
| province | string | recommended | Province abbreviation (e.g. "AB"). Required if country="Canada" |
| region | string | recommended | Required if country is not "United States" or "Canada" |
| zipcode | string | recommended | Required if country="United States" |
| postal_code | string | recommended | Required if country="Canada" |
| zpcode | string | recommended | Required if country is not "United States" or "Canada" |
| city | string | required |
|
| street | string | optional |
|
| phone | string | optional |
|
| url | string | optional | url (venue's website) |
| file_thumbnail | string | optional | filename (show poster. .jpg, .png) |
| fan_club_only | string | optional | "yes" or "no" |
| video.csv |
|
|
|
|
| title | string | required |
|
| weight | int | optional | sorting order |
| url | string | required | video url |
| fan_club_only | string | optional | "yes" or "no" |
- Install iMacros in your preferred browser.
- Download import .iim files (attached here). Place them within your iMacros macros folder.
- Install PHP.
- Download bombplates_import.php (attached here). Place it in the same folder as your CSVs.
- Edit bombplates_import.php. Update the paths at the beginning to match your own file structure and the site you are populating.
- site should be the base URL of the new site (e.g. 'http://someband.bombplates.com')
- filepath should be the full path to your data files with a terminating slash (/ or \ as appropriate) (e.g. '/home/me/downloads/someband.bombplates.com/import/')
- macropath should be the relative path from your iMacros macros path to where you placed the .iim files (e.g. 'Bombplates/import')
- Run bombplates_import.php passing in which CSVs you want to import and save the results as a javascript file
- e.g. from the command line
- $ php bombplates_import.php album blog news > mysite_import.js
- Place your javascript file in your iMacros macros folder.
- Log into the band site as an admin, administrator, or support user
- Run the javascript file using iMacros. This will begin populating data.
- Go get lunch or something.
- Some data will need to be touched up manually after the import finishes.
- Albums and Songs will need to be enabled for the specific portions of the site they should appear in.
- Log into the site
- Go to Content->Audio->Manage Songs (manage/audio-song)
- Click the different locations and drag songs into them as appropriate
- Go to Content->Audio->Manage Albums (manage/audio-album) and do the same
- Songs will need to be assigned to albums
- Log into the site
- Go to Content->Audio->Manage Albums (manage/audio-album)
- Edit each album and add songs
- Very few content types will import with any sense of order unless dates are involved. You'll probably need to sort manually.
- Spot-check the data manually.