Upgrading from Confluence 3 to Confluence 5
This procedure uses PostgreSQL as a Database.
One of the reason for the creation of Greenpepper 4 is the migration to Confluence 5. You will find in the following sections the step we suggest to follow to have a successful migration.
Test your migration first
The first thing you need to know is how to proceed with caution.
The migration steps can be applied for testing the upgrade but you will have to apply more steps in the process.
We will indicate when a step is specific for testing or not.
We will not rewrite here the full Upgrade Guide of Atlassian. We will focus on the part related to GreenPepper.
Before the migration
You will need to do some changes in the database.
Things that you will need to keep next to you.
The list of confluence spaces related to GreenPepper. They are the spaces where you have some executable specification.
For this you can connect to the GreenPepper database and look at the uident column of the repository table.
select substring(uident from 12) from repository;
substring -------------------------- SpaceKeyA SpaceKeyB (8 lignes)
Do you want to keep the wiki syntax of your pages when migrating ?
Note that we use in this SQL request the result of the preceding one.
update bodycontent set body = '{greenpepper-wiki}'|| body ||'{greenpepper-wiki}' where bodycontentid in ( select bodycontentid from content join bodycontent using(contentid) join spaces using(spaceid) where spacekey in ('SpaceKeyA','SpaceKeyB') and body !~ '^{greenpepper-wiki}.*{greenpepper-wiki}$' and contenttype = 'PAGE' and version = (select max(version) from content as c where c.title = content.title)order by title,version);
Remove the {code} macro in GreenPepper Spaces
Usually, you have used the {code} macro in confluence 3 in place of the more correct macro {noformat} . In Confluence 5, this code macro generates complex HTML that you don't intend to test.
update bodycontent set body = regexp_replace(body,'{code(:[^}]*)?}','{noformat}','g') where bodycontentid in ( select bodycontentid from content join bodycontent using(contentid) join spaces using(spaceid) where spacekey in ('SpaceKeyA','SpaceKeyB') and contenttype = 'PAGE' and version = (select max(version) from content as c where c.title = content.title) order by title,version);
Solve the migration issue of {color} macro.
The color macro is not migrated and creates invalid content.
update bodycontent set body = regexp_replace(body,'{color(:[^}]*)?}','','g') where bodycontentid in ( select bodycontentid from content join bodycontent using(contentid) join spaces using(spaceid) where spacekey in ('SpaceKeyA','SpaceKeyB') and contenttype = 'PAGE' and version = (select max(version) from content as c where c.title = content.title) order by title,version);
TESTING ON A STAGING PLATFORM
When testing on a Staging platform, your URLs will change. Let's say it was confluence.mycompany.com and on the staging platform test.mycompany.com. You need to update the greenpepper database to set this change.
begin; update repository set base_url = replace(base_url, 'confluence.mycompany.com', 'test.mycompany.com') , base_repository_url = replace(base_repository_url,'confluence.mycompany.com', 'test.mycompany.com'), base_test_url = replace(base_test_url,'confluence.mycompany.com', 'test.mycompany.com'); end;