August 2014 Core Updates #4

Database backup capability now in the core

A new class called WireDatabaseBackup has been added to the core. It provides an easy way to backup and/or restore from the API. To make a new backup file you can do this:

$file = $database->backups()->backup(); 

To restore a backup file, you can do this:


Both the backup() and restore() methods also accept several options for limiting the backup to certain tables, adding annotations and more. For details, see backup options and restore options.

Plans for the WireDatabaseBackup class are for it to be used by our main installer. It will also provide future backup options before making changes to fields, templates or modules, so that you have undo capability. A future automated upgrade utility for the core will also be using the backups function.

Please note that the restore function is only designed to restore backups created by the backup function. While it may also work with other SQL dump files, don't assume it will work. Make sure you have a good "backup" when experimenting with these new functions, as these are brand new and not widely tested just yet.

Process modules are now a lot smarter

All interactive modules that run in the ProcessWire admin extend the base Process class. We've added some new capabilities to that class to make development of Process modules even simpler.

Headlines and breadcrumbs
Now you can call $this->headline("Your Headline"); in your Process module to set the headline, and $this->breadcrumb("path", "Label"); to add an item to the breadcrumb trail. However, usage is of course optional. The base Process class now adds these things for you automatically where appropriate. So you only need to set the breadcrumbs or headline if you find that you want to vary from what the base Process class has automated for you.

Incidentally, you could set the headline and breadcrumbs relatively easily before, but the code to do it was just plain ugly, and these new methods are a lot cleaner and easier to remember.

Automatic page creation (and removal)
Every Process module needs a page to live on. Previously your Process modules had to create that page on their own (from the install method), and likewise remove it (from the uninstall method). Now the base Process class will do this for you. Simplify specify a page property in your getModuleInfo() function, like this:

public static function getModuleInfo() {
  return array(
    'title' => 'Hello World',
    'version' => 1,
    'summary' => 'Just saying hello',
    'icon' => 'globe', // fa-icon to show with module
    'permission' => 'hello-world', // required permission to use
    'permissions' => array( // permissions to create at install
      'hello-world' => 'Use the fun Hello World process',
    'page' => array( // create a page at install
      'name' => 'hello-world',
      'parent' => 'setup'

Note that page property above. It is an array containing the name of the page you want to create, and the parent page where it should live. In this case, this Hello World module will be added below the Setup page, since we've specified "setup" as the parent (which is the page name). The parent may also be omitted, in which case the page will be added with admin root as parent. You can also specify a title property if you want to here. If omitted the module title is used instead.

When you specify this page property in your module information like above, that page will be created automatically (at installation time) and your Process module will be assigned to it. When/if the module is uninstalled, the page will be automatically trashed.

The above module information also demonstrates a few other recently added properties (mentioned in previous core notes), including icon and permissions.

Database backups module

This is a new module that brings the backups capabilty (mentioned earlier) into an interactive Process module. If you are running the latest dev branch, you can install this module directly by zip file or by grabbing it on GitHub. While this module is not currently part of the core, we will add it if there is demand for it. Otherwise it will be added to the modules directory once ProcessWire 2.5 is released.

This module is a work in progress, and there's still more to add. But we hope you find it useful. Consider it very much a beta test module at the moment, so don't make it your main backup/restore solution just yet.


  • Michael Brett

    Michael Brett

    • 6 years ago
    • 42
    Just a quick thought on the tables to include part of this module.

    As all tables are included by default, could the select be changed to select those that you do not wish to include, as that is most likely a smaller selection.
    For example select 'caches' to be excluded.

    Also, it would be good I think to have 2 selects, one for tables to exclude completely and one to select tables whose data should be excluded, but still keeping the table (TRUNCATE).

    Going to post this in the forums, and downloading now for a more in depth look.

    Thanks for this, it will be a great addition to Processwire.


PrevAugust 2014 Core Updates #3

ProcessWire 2.5 testing, new template import/export functions, change to how input fields collapse, more CKEditor upgrades, and new download capabilities in WireHttp class. More 

NextHanna Code Editor Upgrades

The Hanna Code editor now supports a lot more Ace Editor features that you may find helps a lot when working with Hanna Codes.  More 

Twitter updates

  • This post covers a few of the bigger updates in ProcessWire 3.0.154+3.0.155. This includes new live replacement of text in core and modules, a new method for creating canonical URLs, and some major upgrades to our input->urlSegment() method! More
    24 April 2020
  • A brief look at what's new in ProcessWire 3.0.154 in this forum post: More
    17 April 2020
  • This week we’ve got a few new and interesting core updates in progress, though none quite ready to release just yet. So rather than releasing version 3.0.154 today, I thought we'd instead take a brief look at what’s coming over the next few weeks… More
    3 April 2020

Latest news

  • ProcessWire Weekly #311
    In the 311th issue of ProcessWire Weekly we're going to talk a bit about the latest dev versions of ProcessWire, introduce a couple of new third party modules, and more. Read on! / 25 April 2020
  • ProcessWire 3.0.154 and 3.0.155 core updates
    This post covers a few of the bigger updates in ProcessWire 3.0.154 and 3.0.155 on the dev branch. This includes a new function for live replacement of text in core and modules, a new method for creating canonical URLs, and some major upgrades to our $input->urlSegment() method that I think you’ll like!
    Blog / 24 April 2020
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.