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.
wp-content/plugins
folder.composer install --no-dev
within the wp2grav_exporter
folder to install dependencies.wp plugin activate wp2grav_exporter
or via the admin gui.wp wp2grav-all
to export all items. See other options below.WP_ROOT/wp-content/uploads/wp2grav-exports/DATE
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.
Wordpress users on left exported to Grav on the right.
wp wp2grav-users
will generate Grav user account files.
EXPORT/accounts/
.
Copy the EXPORT/accounts
folder to your user
directory (e.g. username.yaml files should be placed at user/accounts
).
Wordpress users with roles on left exported to Grav groups on the right.
wp wp2grav-roles
will generate a Grav groups.yaml file.
Wordpress user roles export as Grav groups in a groups.yaml
file at config/groups.yaml
. Some notes about the role exporting:
wp_<ROLE_WITH_UNDERSCORES>
(e.g. subscriber
becomes wp_subscriber
).wp_administrator
group.wp_administrator
group receives admin.super
access along with admin.login
access. Accounts with these permissions are full admins on the site!wp_authenticated_user
group receives admin.login
access.Copy the EXPORT/config
folder to users/config
.
Wordpress post types are converte to Grav page types, with a pre-pended "WP" in front of each type (highlighted in yellow here).
wp wp2grav-post-types
will generate a basic Grav theme, along with page types that match the Wordpress post types.EXPORT/themes
folder to your user
directorySystem
configuration to the Wordpress Export
theme.Admin view of Wordpress "Sample Page" on left exported to Grav markdown on the right.
User view of Wordpress "Sample Page" on left exported and rendered via Grav on the right.
wp wp2grav-posts
will export all posts.data/wp-content
and in-line content will (eventually) be included within the page's directory.EXPORT/pages
folder to your user
directoryEXPORT/data
folder to your user
directoryAdmin view of WordPress General Settings on left exported to Grav Site Config on the right.
wp wp2grav-site
will export site metadata.EXPORT/config/site.yaml
.EXPORT/config/site.yaml
folder to Grav at user/config/site.yaml
.