Skip to content

Knowledgebase

Renaming a cPanel database without losing the application connection

cpanel-whm, development

Renaming a database changes the identifier an application uses to connect. It does not automatically update every configuration file, scheduled command or external integration that refers to the old name.

What you need before you begin

Export the database and back up the application configuration first. Identify all applications that share it and plan a short maintenance window. If the database is large or business-critical, test the procedure on a copy and confirm the hosting platform supports the rename operation.

01 Rename a cPanel database without losing the application connection

  1. Open Manage My Databases in cPanel, called MySQL Databases in older layouts. Find the exact database under the current database list.
  2. Choose its Rename action if available. Enter the new permitted name and carefully review the complete prefixed result before confirming.
  3. Update each application configuration and scheduled task that uses the old database name. Keep the existing database user and password unless you are intentionally rotating those credentials too.
  4. Check the user’s assignment and privileges for the renamed database. Reconnect through phpMyAdmin or the application to inspect its tables.
  5. Bring the application out of maintenance only after a read and a controlled write both work.

Confirm the expected result

Verify a normal page, administrator login and a database-backed change. Search your deployment configuration for the old name so the next release does not reintroduce it.

What if database renaming is unavailable or the application stops connecting?

If the rename control is missing, ask support about the supported method rather than issuing ad hoc filesystem commands. If the application fails afterward, compare its configured name with cPanel and restore the prior name or configuration through a planned rollback. Keep the export until verification is complete.

Sources and further reading

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support

Powered by WHMCompleteSolution