jgonyea / wp2grav_exporter

Exports Wordpress content to GravCMS
MIT License
6 stars 0 forks source link

Grav Export

Requirements

PHP v7.1 or above for the composer dependencies. WP-CLI Working Wordpress 5 site from which content will be exported. R/W access to wp-content/uploads on the Wordpress site.

Installation

  1. Download and move this plugin to your Wordpress's wp-content/plugins folder.
  2. Run composer install --no-dev within the wp2grav_exporter folder to install dependencies.
  3. Enable it via wp plugin activate wp2grav_exporter or via the admin gui.
  4. Run wp wp2grav-all to export all items. See other options below.
  5. Exported files are located at WP_ROOT/wp-content/uploads/wp2grav-exports/DATE
  6. For Grav v1.6 sites, https://github.com/david-szabo97/grav-plugin-admin-addon-user-manager is recommended to view and manage users. This is not required for Grav 1.7+ sites.

Notes

Running wp wp2grav-all will run each of the following export steps at once. Afterwards, follow each section below on how to import the new data to a Grav install.

Exporting Users from Wordpress

Wordpress users exported to Grav

Wordpress users on left exported to Grav on the right.

Command

wp wp2grav-users will generate Grav user account files.

Results

Importing Users to Grav

Copy the EXPORT/accounts folder to your user directory (e.g. username.yaml files should be placed at user/accounts).

Exporting User Roles from Wordpress

Wordpress roles exported to Grav groups

Wordpress users with roles on left exported to Grav groups on the right.

Command

wp wp2grav-roles will generate a Grav groups.yaml file.

Results

Wordpress user roles export as Grav groups in a groups.yaml file at config/groups.yaml. Some notes about the role exporting:

Importing User Roles

Copy the EXPORT/config folder to users/config.

Exporting Post Types from Wordpress

Exported post types

Wordpress post types are converte to Grav page types, with a pre-pended "WP" in front of each type (highlighted in yellow here).

Command

Results

Importing Post Types to Grav

Exporting Posts from Wordpress

Sample page, admin view

Admin view of Wordpress "Sample Page" on left exported to Grav markdown on the right.

Sample page, page view

User view of Wordpress "Sample Page" on left exported and rendered via Grav on the right.

Command

Results

Importing Post Types to Grav

Exporting Site metadata from Wordpress

Sample page, admin view

Admin view of WordPress General Settings on left exported to Grav Site Config on the right.

Command

Results

Importing Post Types to Grav