wingspress/README.md

55 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2021-01-25 14:25:44 +00:00
# wingspress
Tool for migrating Wings content to WordPress.
2022-01-03 12:08:32 +00:00
## Requirements
- [NodeJS](https://nodejs.org/)
- [Yarn](https://yarnpkg.com/)
## Pull in mobile-doc-wp-renderer
2022-01-03 12:08:32 +00:00
<!-- git clone git@gitlab.com:bij1/site/mobiledoc-wp-renderer.git -->
git submodule init
git submodule update
## Build mobile-doc-wp-renderer
2022-01-03 12:08:32 +00:00
```bash
cd mobiledoc-wp-renderer
yarn install
2022-01-03 17:36:51 +00:00
yarn build
2022-01-03 12:08:32 +00:00
cd ..
```
## `yarn install`
Install all the dependencies
2021-01-25 14:25:44 +00:00
## `yarn fetch`
Fetches all content from Wings and saves it to `content.json`,
2022-01-03 17:36:51 +00:00
requires setting environment variables, for example:
2021-01-25 14:25:44 +00:00
```
2022-01-03 17:36:51 +00:00
export WINGS_ENDPOINT=https://api.wings.dev
2022-08-01 11:16:59 +00:00
export WINGS_PROJECT=<PROJECT_ID>
2022-01-03 17:36:51 +00:00
export WINGS_APP_KEY=<APP_KEY>
2021-01-25 14:25:44 +00:00
```
2022-08-01 11:16:59 +00:00
These credentials can be generated by adding an App in the Wings admin
backend.
2021-01-25 14:25:44 +00:00
## `yarn migrate`
Converts all articles and pages that do not exist in WordPress yet and
2022-08-01 11:16:59 +00:00
publishes them along with their media, requires setting environment
variables, for example:
2021-01-25 14:25:44 +00:00
```
2022-01-03 17:36:51 +00:00
export WP_ENDPOINT=http://localhost:8000/wp-json
2022-08-01 11:16:59 +00:00
export WP_USER=<USERNAME>
export WP_PASSWORD=<APPLICATION_PASSWORD>
2021-01-25 14:25:44 +00:00
```
2022-08-01 11:16:59 +00:00
Note that using this API requires a specific application password
which can be generated from the user management page.