|
| 1 | +--- |
| 2 | +title: Migrate CB-GH to CB-CSV |
| 3 | +parent: Advanced |
| 4 | +nav_order: 14 |
| 5 | +--- |
| 6 | + |
| 7 | +# Migrate CollectionBuilder-GH project into CollectionBuilder-CSV |
| 8 | + |
| 9 | +Sometimes you will have created a prototype collection using CB-GH or CB-Sheets and find that you would like to continue developing it in the more robust CB-CSV template. |
| 10 | +It is straight forward to migrate your project by updating your metadata and copying over your objects into a new CB-CSV project (in most cases this is much easier than updating the template in your existing repository!). |
| 11 | + |
| 12 | +First, create a new project repository from [CB-CSV template](https://github.com/CollectionBuilder/collectionbuilder-csv). |
| 13 | + |
| 14 | +## Copy Objects |
| 15 | + |
| 16 | +Copy the files in your CB-GH project "objects" folder. |
| 17 | +Paste them into the "objects" folder in your new CB-CSV project. |
| 18 | + |
| 19 | +Open a terminal and run `rake generate_derivatives` (see [Objects Derivatives for more info](/cb-docs/docs/objects/derivatives/)). |
| 20 | + |
| 21 | +In ".gitignore", comment out `objects/`. |
| 22 | + |
| 23 | +Commit the objects into the repository. |
| 24 | + |
| 25 | +## Update Metadata |
| 26 | + |
| 27 | +Open your existing CB-GH metadata in Sheets or OpenRefine. |
| 28 | +You will need to add [CB-CSV's technical metadata fields](https://collectionbuilder.github.io/cb-docs/docs/metadata/csv_metadata/#strongly-suggested-fields), which can be done using equations to transform your existing columns (see [Recipes for generating Object Location Fields](/cb-docs/docs/metadata/object-paths/)). |
| 29 | + |
| 30 | +- "display_template": from your CB-GH "format" field, create a new column "display_template". Edit all "image/jpeg" to `image`, "application/pdf" to `pdf`, " |
| 31 | +- "object_location" From your CB-GH "filename" field, create a new column "object_location". |
| 32 | + - For items with a local filename, put `/objects/` in front of the filename value. |
| 33 | + - For items with a full URL, leave as is. |
| 34 | + - For items with "youtubeid" or "vimeoid", use the id to create the full youtube link in "object_location". |
| 35 | +- Set up "image_small" and "image_thumb" from "filename". |
| 36 | + |
| 37 | +## Transfer Configurations |
| 38 | + |
| 39 | +Carefully compare the various configuration files in your CB-GH project with the default ones in your new CB-CSV project. |
| 40 | +CB-CSV will have slightly MORE options than the CB-GH versions, so they can not be just copied over. |
| 41 | +Transfer the configurations values from your CB-GH project into CB-CSV where they match. |
| 42 | +Check over these files: |
| 43 | + |
| 44 | +- "_config.yml" |
| 45 | +- "_data/theme.yml" |
| 46 | +- Configs in "_data/": "config-browse.csv", "config-map.csv", "config-metadata.csv", "config-nav.csv", "config-search.csv", "config-table.csv", and "config-theme-colors.csv" |
| 47 | +- "_sass/_custom.scss" |
| 48 | + |
| 49 | +## Transfer Content Pages and Customizations |
| 50 | + |
| 51 | +Carefully check over any pages that you have directly customized or added content to. |
| 52 | +Most commonly this would include: |
| 53 | + |
| 54 | +- "pages/about.md" |
| 55 | +- "_layouts/home-infographic.html" |
| 56 | + |
| 57 | +## Setup to Deploy with GitHub Actions |
| 58 | + |
| 59 | +For the [docs for deploying using GitHub Actions](/cb-docs/docs/deploy/actions/). |
0 commit comments