This is a development setup for the Wagtail Wordpress Import plugin. Wagtail Wordpress Import is a package for Wagtail CMS to import WordPress blog content from an XML file.
Run the following commands to install the developer setup.
# clone this repo
git clone https://github.com/nickmoreton/wwi-docker-develop
# change to the wwi-docker-develop directory
cd wwi-docker-develop
# install dependencies with poetry and run the setup
poetry shell
poetry install
./setup.sh
Once you have followed the above steps, you will be able to access.
- Wagtail admin interface at http://[local-ip]:8000/admin
- WordPress admin interface at http://[local-ip]:8080/wp-admin
To manage the docker containers.
fab -l
All Commands
General
build
Build the wagtail docker containerdestroy
Destroy the docker containers. THIS WILL ALSO REMOVE - THE DATABASESinit
Install WordPress CLI and import the XML theme - fixures with media files (run this second)start
Start the docker containersstartbuild
Build & Start the docker containersstop
Stop the docker containers
Wordpress
permalinks
Change the WordPress permalink structure to /%postname%/run-import
Run the import to Wagtailtheme
Install a WordPress theme and switch to ittheme-delete
Un-install a WordPress theme by nametheme-install
Install a WordPress theme by namewpexport
Export the WordPress data to an XML filewprestart
Restart the WordPress containerwpstart
Start the WordPress containerwpstop
Stop the WordPress container
Wagtail Wordpress Import / Django
sh
Open a bash shell in the docker development containerrun-import
Run the import to Wagtailrun-tests
Run the tests for the Wagtail WordPress Impoterrun-delete
Delete all the imported pages. Optionally delete the images and documentsrun-del-documents
Delete all the imported documentsrun-del-images
Delete all the imported images
After and initial setup running ./setup.sh
the following fab commands are the most useful.
- start
- run-tests
- run-import (this will import the XML data again and only update existing pages)
- run-delete (run with the args
--images
and/or--documents
) - run-del-documents
- run-del-images
It can take a while for the WordPress site to be available at http://localhost:8080 Once running you should see the WordPress site populated with dummy blog posts and pages all with images and text content.
Using the fab commands you can swap out the WordPress theme and install a new one and export the XML data to a file. When you use that data file as the import source for your development the images and documents will be available locally via the runnning WordPress site. This is useful for develpment and testing the importer without having to download media etc. from a remote site.
You can login to the WordPress site at http://localhost:8080/wp-admin using the preset username/password of admin/password
. If you want to change these login details look at the env.example
file.
You can work with the WordPress site files: un-comment the lines indicated in the docker/docker-compose-wordpress.yml
file. In theory, but not tested, you could add your own WordPress site files to the ./wordpress
directory so you can work with your own data and media files.
Although this is done during setup you can run it again.
Run fab wpexport
. An XML file named export.xml
will be saved to the XML folder.