Recommended releases

Download Released

The WordPress connection hub for the Acuity migration tools. It provides a single, shared connection to a legacy WordPress database, plus the WordPress Migration Centre page (connection form + a "which tables to export" helper) and the WordPress section on the Acuity Migration Centre dashboard (the separate acuity_migration module).

This module contains no import logic of its own - it is the hub that the actual WordPress importers depend on. Install it once, point it at your WordPress database, and each WordPress migration tool appears on the dashboard under WordPress.

When your migration is complete and the individual migration tools have been removed, you can safely uninstall this module.

Requires

The Acuity Migration Centre (acuity_migration) module, which provides the shared dashboard.

Initial version

This is a beta release for code review and testing.

Requirements

  • Backdrop CMS 1.x
  • A secondary database connection to the WordPress database, defined in settings.php.
  • At least one migration tool (e.g. Acuity WordPress User Import) to do anything useful.

Installation

Install this module using the official Backdrop CMS instructions at https://docs.backdropcms.org/documentation/extend-with-modules

Add the WordPress database configuration to your settings.php file (see Documentation below), enable the module, then set the connection at Configuration → Acuity Migration Centre → WordPress Migrations → WordPress Migration Centre.

Documentation

  1. Database Configuration

Define the connection to the WordPress database in your site's settings.php. The prefix must be empty to query wp_users directly. host may be 127.0.0.1, localhost, or a remote database host.

$databases['wordpress']['default'] = array(
  'driver' => 'mysql',
  'database' => 'your_wordpress_db_name',
  'username' => 'db_user',
  'password' => 'db_pass',
  'host' => '127.0.0.1',
  'prefix' => '',
);
  1. Setting the Connection
  • Open Configuration → Acuity Migration Centre (admin/config/acuity-migration), then the WordPress Migration Centre card under WordPress Migrations.
  • Enter the Database Key you defined in settings.php (default wordpress).
  • Click Test Connection to verify connectivity and that the WordPress tables are found, then Save Connection Settings. The same page shows the "which tables to export" helper.
  1. The Dashboard

The Acuity Migration Centre dashboard at admin/config/acuity-migration groups tools by platform. WordPress tools appear under WordPress Migrations; enable a tool such as Acuity WordPress User Import and it appears there.

For developers (integrating a migration tool)

A WordPress migration tool integrates in two ways:

  • Register a card - implement hook_acuity_migration_group_info() (from the acuity_migration hub), returning one or more cards in the wordpress category:

    function mymodule_acuity_migration_group_info() {
      return array(
        'mytool' => array(
          'title' => t('My Migration Tool'),
          'description' => t('Imports my content from WordPress.'),
          'url' => 'admin/config/acuity-migration/wordpress/mytool',
          'category' => 'wordpress',
          // Optional: tables the import reads, for the export helper.
          'export_tables' => array('wp_posts', 'wp_postmeta'),
        ),
      );
    }
  • Get the shared connection - call acuity_wpmc_get_database(). It returns a Backdrop database connection to the configured WordPress database, or FALSE on failure - always guard for FALSE:

    $wp = acuity_wpmc_get_database();
    if (!$wp) {
      // Connection not configured or unavailable.
      return;
    }
    $count = $wp->select('wp_users', 'u')->countQuery()->execute()->fetchField();

Current consumers: Acuity WordPress User Import (acuity_wpuser) and Entity Forum Importer (its WordPress bbPress source).

Issues:

Bugs and Feature requests should be reported in the Issue Queue: https://github.com/backdrop-contrib/acuity_wpmc/issues

Current Maintainer(s):

Credits:

  • Assisted by AI

Sponsorship:

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.