How to manually edit a page title through the database with Synchrony enabled

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Scenario

The following SQL commands can be helpful in order to edit page title when having issues.

If you are unsure how to deal with the database, contact your DBA. Make sure to have the database backed up completely before going further. These SQL commands were tested in some environments and they worked as intended.

However, it might not work in specific cases and newer versions of confluence as new constraints as changes may be done to confluence database structure. As such, a database backup is mandatory in case something goes wrong and you need to revert.

Problem

As mentioned in our Create and Edit Pages guide, we recommend to not use special characters in the page title, many problems can happen when doing so. Below are some noticeable bugs:

CONFSERVER-42851 - Getting issue details... STATUS
CONFSERVER-41481 - Getting issue details... STATUS
CONFSERVER-43534 - Getting issue details... STATUS

Possible stack trace in the application logs:

Caused by: java.io.IOException: Error while processing callback: com.ctc.wstx.exc.WstxIOException: Invalid white space character (0xb) in text to output

Resolution

Ran in PSQL


1) Shutdown Confluence, access your Confluence database and run:

select * from content where title = '<page-title>';


2) After finding the problematic page, we will update its title to another one:

update content set title ='<New-Page-Title>', lowertitle='<New-Page-Title>' where title ='<current-page-title>';


With Synchrony ON (Collaborative Editing Enabled)

1) After updating the page title, we need to delete the SharedDraftID reference to not pull the old title but first, we need to find it. To do this, enter the page editor mode, in the url you will find something similar to:{{draftShareId=57633191-642a-47c6-a80e-442470d1b517}}. Run the select query:

select * from contentproperties where stringval = '57633191-642a-47c6-a80e-442470d1b517'; ## this is the shareddraftid


2) You will find the draft contentid and we need to remove its properties:

delete from contentproperties where contentid = <contentid>;


If you are unable to enter the edit mode, you can find the same SharedDraftID in the DB and run the delete query from above:

SELECT c.contentid, c.title, cp.stringval
FROM content c
JOIN contentproperties cp ON c.contentid = cp.contentid
WHERE c.contenttype = 'PAGE' AND c.title = <'pagetitle'> AND cp.propertyname = 'share-id';

Restart Confluence for the changes to take effect.

Last modified on Dec 13, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.