Last week's post was about the pages export/import module being developed for ProcessWire. This week we continue that trend. But rather than showing you screenshots of it, I've added the new pages export/import module to the core so that you can start using it instead!
If you look in the commit log, you'll see there have been quite a lot of core updates today. All of those were developed over the last week, and then all committed this morning. Most of these commits are related to the pages export/import features, which required numerous updates throughout the core, especially to some core Fieldtype modules. This is one of the reasons why the pages export/import module is being added to the core right now–it's pretty well tied to the core version at present. Though this won't be the case as time goes on, but I still think it belongs in the core long term either way. Once you start using pages export/import, chances are you won't want to be without it. At least that's what I've found so far.
Installing pages export/import
Grab the latest version of the ProcessWire dev branch, which is 3.0.71 (or newer, if you are reading this later).
If this is an existing ProcessWire installation, go to Modules > Refresh, so that ProcessWire can see the newly added module.
Now to go Modules > Core (tab) > Process (section) > Pages Export/Import (module), and click the Install button.
Once installed, you should now have an "Export/Import" item in your "Pages" top navigation.
Now you are all set–take it for a spin. However, note that this module is very much a testing version and not yet ready for production use. So if you use it in production (especially for import) just make sure you have the ability to revert if anything gets messed up (always have backups).
Thanks for helping to test this module out. Please report any issues you run into at our GitHub ProcessWire Issues repository.
What’s been added to export/import since last week's post?
Quite a bit actually:
Added support for all core Fieldtypes except for Comments, Repeater, and PageTable. Support for these is on the way though.
Added support for multi-language Fieldtypes, including the ability to export/import between two multi-language installations and between multi-language and non-multi-language installations (in either direction).
Added support for multi-language page names (URLs) and published status.
Added the ability to select a replacement template on import when the system lacks the needed template for one or more pages.
Added the ability to select replacement fields when the system being imported to lacks one or more fields present in the import data.
Added the ability to target a different parent for import than what is specified in the export. You can choose to maintain the structure of pages below that parent, or import all pages as direct children of selected parent.
Added file and image import support to JSON imports (previously only supported in ZIP files). Since files aren't technically part of the export data, the files must be HTTP accessible in order to be imported when using JSON export/import.
What's still left to do?
- Repeater and PageTable support
- Comments field support
- ZIP file export and import
- ProFields support (not yet tested, some may already work)
- Support for paginated exports/imports (when too large to process in one request)
I opted to leave out the ZIP file support for this first version, because I felt like more work was needed there than there was time for this week. In addition, I focused on the JSON export/import support first because I find it a lot more convenient to work with, copying/pasting between systems. JSON is also nice for export/import data because it's a trivial matter to modify it or search/replace things that you want to adjust when migrating data between two different systems. However, ZIP support will be coming soon, and needed especially when migrating data that includes files from a local (non-HTTP accessible) dev environment to a production server. That's one of the big reasons to have ZIP support in a tool like this.
Support for 3rd party Fieldtypes
Most 3rd party Fieldtypes should already work, but some likely won't and I'm happy to assist in making them work. If a Fieldtype doesn't work for export or import using the default/fallback methods, it's fairly simple to add support for it. The Fieldtype just has to implement exportValue() and importValue() methods. In most cases, it won't be necessary for a Fieldtype to do so unless it storing data outside of the "field_[name]" table. This is why Fieldtypes like Repeater and Comments don't work just yet (but soon will).
If you are a ProFields user, please stay tuned to the ProFields support boards as I'll be posting updates to add export/import support to those that don't yet support it. Repeater Matrix will support export/import on the same timeline as regular core Repeaters.
Next week I'll be working through some of the "to do" list above, and also catching up with some client work. With kids back in school (as of August 2), my work days are now a little shorter as my 4-year-old needs me from 2pm onward every day (school gets out at 2). We have a lot of fun! Admittedly it makes it little harder to keep up with the same amount of work (though waking up earlier solves a lot). But with a shorter schedule, next week I need to catch up on some details and communications. Rather than having a full blog post, I'll post a PW version update summary in the forums instead. Then the following week we'll have a full blog post again.
Thanks for reading, and please let us know how the export/import works for you. Stay tuned to the ProcessWire Weekly for great new content every weekend.
Your e-mail is kept confidential and not included with your comment. Website is optional.