Ghost/test/utils/fixtures/export
Matt Hanley eae0a6a3b9
Added products and Stripe data to exports and imports (#14873)
- The migration path from 4.x on SQLite to 5.0 on MySQL requires an export/import
- Exports don't include the Stripe info required to map members to tiers correctly on import. This change fixes that.

Co-authored-by: Simon Backx <simon@ghost.org>
Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
2022-05-20 21:13:58 +01:00
..
body-generator.js Added benefits, offers and snippets to exporter 2022-05-20 20:30:55 +01:00
broken.json Move tests from core to root (#11700) 2020-03-30 16:26:47 +01:00
products_export.json Added products and Stripe data to exports and imports (#14873) 2022-05-20 21:13:58 +01:00
README.md Updated export fixture for Ghost 4.0 2021-03-24 18:37:57 +13:00
v2_export.json Updated export fixture for Ghost 2.9 2021-03-24 20:00:34 +13:00
v3_export.json Updated export fixture for Ghost 2.9 2021-03-24 20:00:34 +13:00
v4_export.json Fixed typo "in" default About page. (#13271) 2021-10-04 12:18:15 +01:00
valid.json Updated importer to transform 'card-markdown' to 'markdown' (#12650) 2021-02-15 16:42:01 +00:00

Steps to generate a new vX_export.json file:

  1. ghost install --version 3.0.0 - install a local version of Ghost using the X version
  2. When prompted for blog details use following data for consistency:
  • blog URL: accept default (http://localhost:2368)
  • MySQL hostname: whatever is configured locally (localhost in my case)
  • MySQL username: whatever user is configured locally
  • MySQL password: whatever is configured locally for the user
  • Ghost database name: accept default (fresh_3_0_prod as an example)
  • "ghost" MySQL user: n (unless you need one for your local setup)
  • set up Systemd: n (no reason to set this up locally)
  • start Ghost: n (need to fix permissions first)
  • run sudo chown -R $USER:$USER content (this is needed for local setup as the CLI creates content folder with ghost:ghost permissions)
  • start Ghost instance: ghost start
  1. Register with test user account with following details:
  • Testing Export Fixtures - Site title
  • Fixture Ghosty - Full name
  • {your_email}@ghost.org - Email address (I used naz@ghost.org as an example, this is to prevent spamming test@ghost.org)
  • Password - generate one (for example use 1Password to autofill it)
  1. Go to Admin panels's labs page and download an export (/settings/labs page and "Export your content" section)
  2. Format and rename exported data: jq . testing-export-fixtures.ghost.2021-03-24-01-15-52.json > v3_export.json (can use vX_export.json where X is a Ghost version number)
  3. Copy the file into /utils/fixtures/export project folder by running e.g.: cp ./v3_export.json ~/Ghost/test/fixtures/export/
  4. Replace email used during registration with a generic test@ghost.org can use following command sed -i 's/naz@ghost.org/test@ghost.org/g' v3_export.json (replace naz@ with an email you used and use appropriate json file name)
  5. Check the tests and commit new/updated export file

Note, the export contains Ghost's default configuration with no customizations. In the future iteration it would be useful to add more custom data like users with different roles, multiple posts and pages with different sets of customizations like metadata, pictures and so on.