A db command for DDEV to rename tables prefix of WordPress installations
For DDEV v1.23.5 or above run
ddev add-on get biati-digital/ddev-wp-rename-tables-prefix
For earlier versions of DDEV run
ddev get biati-digital/ddev-wp-rename-tables-prefix
There are several ways to run the command but the most simple way is:
ddev wp-rename-tables-prefix --to=new_
If you only provide --to, the command will try to get the current table prefix directly from the database. If the current table prefix can not be found you can provide it.
ddev wp-rename-tables-prefix --from=old_ --to=new_
--silent=true to disable multiple messages that are printed when running the command.You can run ddev help wp-rename-tables-prefix for help
The command has not been tested in multisites installations
Before running the command make sure to create a database snapshot ddev snapshot just in case.