Convert space Metadata into global Metadata
At the moment migrating Metadata values from Data Center to cloud is only supported for values of global Metadata fields and sets. As a workaround space Metadata fields and sets can be converted into global ones to make a migration possible.
The conversion is a manual process that must be carried out at database level and must be performed individually for each field or set to be converted. In details, the prefix "global." is added to the respective field or set key. In addition, the assignment to a space is deleted. These adjustments mean that the fields and sets are then recognized as valid global fields and sets. The assignment of Metadata values and content is not affected by the changes.
When can I use this approach?
It is recommended to use this approach really just in case you’re going to migrate your data from Data Center into the cloud and you don’t have the plan to continue the usage of your DC instance.
When should I not convert space Metadata into global Metadata
In case you want to modify or adjust your use cases on Data Center and you just want to make your space Metadata globally available.
Important notes before you start
Communardo GmbH or its subsidiaries accept no responsibility for changes made on the basis of this documentation. The customer alone bears the risk.
In general only use this approach if no other possibility is left
Back up your database
Make sure that no changes are made to Metadata fields or sets during the conversion (neither via the frontend nor directly via the database). Changes can be made both via admins and space admins.
The scripts listed below are created for use in PostgreSQL databases. If used in a different database, a syntactic adaptation may be necessary. This adaptation is the responsibility of the customer.
Steps to convert space Metadata into global Metadata
The sequence of the individual steps must be strictly adhered to.
Back up your database
Check if the target Metadata field and Metadata set names are still available.
The validation is successful when a check (statement) returns “0”. Replace <MY-SPACE-METADATA-FIELD-NAME> with the Key from the Space metadata fields overview for the field you want to convert.
Replace <MY-SPACE-METADATA-SET-NAME> with the Key from the Space metadata sets overview for the set you want to convert.
/** * Check if the target Metadata field name is still available. */ SELECT COUNT(*) FROM "AO_575936_MDFIELD" WHERE "KEY" = 'global.metadatafield.<MY-SPACE-METADATA-FIELD-NAME>'; /** * Check if the target Metadata set name is still available. */ SELECT COUNT(*) FROM "AO_575936_MDSET" WHERE "KEY" = 'global.metadataset.<MY-SPACE-METADATA-SET-NAME>';Manipulate and validate your Metadata fields
Use the following sql script to convert a space field into a global field
replace <MY-SPACE-METADATA-FIELD-NAME> with the Key from the Space metadata fields overview
replace <MY-SPACE-KEY> with the Key of the current space
Field Manipulation. The manipulation was successful when 1 row/dataset was updated.
/** * Step 1: Update a Metadata field and make the given space field global */ UPDATE "AO_575936_MDFIELD" SET "KEY" = CONCAT('global.', "KEY"), "SPACE_KEY" = null WHERE "KEY" = 'metadatafield.<MY-SPACE-METADATA-FIELD-NAME>' AND "SPACE_KEY" = '<MY-SPACE-KEY>';Validation
The Metadata field must now be listed in the Global metadata field section
No other Metadata field with the same key may exist
If additional warning signs are displayed, these refer to the Metadata field Title. This must also be unique, especially for a subsequent migration of data to the cloud. The adjustment (renaming) can be made via the frontend. Renaming has no consequences for the key. This value remains unchanged.
Manipulate and validate your Metadata sets
Use the following sql script to convert a space set into a global set
replace <MY-SPACE-METADATA-SET-NAME> with the Key from the Space metadata sets overview
replace <MY-SPACE-KEY> with the Key of the current space
Set manipulation. The manipulation was successful when 1 row/dataset was updated.
/** * Step 2: Update a Metadata set and make the given space set global */ UPDATE "AO_575936_MDSET" SET "KEY" = CONCAT('global.', "KEY"), "SPACE_KEY" = null WHERE "KEY" = 'metadataset.<MY-SPACE-METADATA-SET-NAME>' AND "SPACE_KEY" = '<MY-SPACE-KEY>';Validation
The Metadata set must now be listed in the Global metadata set section
No other Metadata set with the same key may exist
If additional warning signs are displayed, these refer to the Metadata field Title. This must also be unique, especially for a subsequent migration of data to the cloud. The adjustment (renaming) can be made via the frontend. Renaming has no consequences for the key. This value remains unchanged.
Site reindex of your Confluence instance
It is mandatory to perform a complete Site reindex of the Confluence instance.