sqlite-database-integration icon indicating copy to clipboard operation
sqlite-database-integration copied to clipboard

Changing the database backend on a live site

Open JanJakes opened this issue 6 months ago • 3 comments

The plugin could support migrating from SQLite to MySQL and the other way around. It would:

  • Help ship SQLite support in WordPress core
  • Encourage people worried about staying locked in SQLite
  • Help move the sites around

Technically, there's a streaming Data Liberation part to it where we track progress, handle deltas etc. Maybe it's a site sync within one site? Regardless of the implementation, the SQLite plugin could ship the UI.

JanJakes avatar Jun 02 '25 13:06 JanJakes

I have a rudimentary migration script on https://github.com/aristath/sqlite-database-integration/pull/1/files It's pretty basic, but it works - could be used as a starting point for any implementation you may want to build 👍

aristath avatar Jun 04 '25 10:06 aristath

I have this plugin on a site, and the Plugins admin page offered me the upgrade. I upgraded, and it broke the site, due to previously I did not have define( 'DB_NAME', '...' ); in wp-config.php. After inserting this (with an irrelevant content), the page was working again. (Now I see that this is needed for the mysql line, so it's ok.) The error message was:

Error: Undefined constant "DB_NAME" in .../wp-content/plugins/sqlite-database-integration/wp-includes/sqlite/db.php on line 69

szabozoltan69 avatar Jun 04 '25 10:06 szabozoltan69

@szabozoltan69 Oh, thanks for the report! I didn't notice the DB_NAME requirement also affected the current (legacy) driver. I think we can fix that, although the new driver will require the constant to be set.

JanJakes avatar Jun 04 '25 16:06 JanJakes