Migrate CiviCRM from Joomla to Wordpress
In case it helps anyone, this is what I did:

Initial set-up:
- a working Joomla site, with Civicrm and Joomla tables in the same database
- a separate installation of Wordpress on the same server (articles and static content already imported from the Joomla site and redirects set up as required)

Aim: migrate the Joomla Civicrm tables and data to the Wordpress installation. In this case we chose to do it without moving the Civicrm tables, for simplicity.

Result: Wordpress tables and Civicrm tables are in two separate databases


Backup Joomla Civicrm tables or the whole database.
Make a note of:


Civicrm version number in Joomla Civicrm
what components and extensions you have installed in Joomla Civicrm
any user permissions in Joomla Civicrm (if you use permissions).

Install Civicrm in Wordpress (check version is same as Joomla Civicrm).
Install/remove Civicrm components to match the Joomla Civicrm.
Install any Civicrm extensions (check versions) to match Joomla Civicrm.
Export data (should be just one row) from Wordpress Civicrm table civicrm_uf_match. Disable foreign key checks just in case.
In the Joomla Civicrm database, make a copy of table civicrm_uf_match (in case you need to revert to Joomla).
In the Joomla Civicrm database, truncate the table civicrm_uf_match and import the data exported from Wordpress Civicrm table. Preferably disable foreigh key checks.
Edit the Wordpress civicrm.settings.php file (by default it's in wp-content/uploads). Change CIVICRM_UF_DSN and CIVICRM_DSN to point to the Joomla database.
I also edited the row 'userFrameworkUsersTableName' in the table civicrm_setting, to change joomla-table-prefix_users to wp-table-prefix_users, but I don't know if this is necessary.
You should now be able to access the 'old' Civicrm tables through Wordpress.
Civicrm->Administer->Users and permissions->Synchronise Users to Contacts


That's it. There's a bit of tidying up to do (see below), but at this stage you can still easily revert to Joomla if necessary by replacing the table civicrm_uf_match with the copy, and by reversing steps 9 and 10.


Tidy up: manually set up Civicrm user permissions to correspond to the old Joomla setup. Add any missing users. I had already used the FG Migrate Joomla to Wordpress plugin to migrate users and articles from Joomla.
Tidy up: drop all the Joomla tables (and any other non-civicrm tables) from the Joomla database.
Tidy up: drop the civicrm tables from the Wordpress database.


Comments/corrections welcome.