The Content Server does not support automatic renaming of properties, as it
is hard to detect this situation without additional operator assistance. In the following, you find the steps
necessary to consistently rename properties in the doctypes.xml
file and in the database.
Generally, all Content Servers should be migrated at the same time, because an attempt to replicate or publish content between Content Servers with different schema will fail. Alternatively, it should be made certain that a Replication Live Server cannot connect to a Master Live Server while their schemata differ, or that a Content Management Server cannot publish to a Master Live Server while their schemata differ.
Since property names do not occur in the repository ChangeLog
, it is possible to migrate the
Servers even when the Content Server and
repository listeners are not idle before shutdown.
For properties of the type XmlProperty
, proceed as follows:
Stop the Content Server.
Rename the property in the content types definition file.
Execute the following SQL statement with the declaring content type and all its subtypes:
UPDATE Texts SET propertyName = 'myNewName' WHERE propertyName='myOldName' AND EXISTS (SELECT * FROM Resources WHERE id_=documentId AND documentType_ IN ('myType', 'mySubtype1', 'mySubtype2',...));
Rename the internal links. Execute the following SQL statement with the declaring content type and all its subtypes:
UPDATE LinkLists SET propertyName = 'myNewName' WHERE propertyName='myOldName' AND EXISTS (SELECT * FROM Resources WHERE id_=documentId AND documentType_ IN ('myType', 'mySubtype1', 'mySubtype2',...));
- Start the Content Server.
For properties of the type BlobProperty
, proceed as
follows:
Note | |
---|---|
If inline images in XmlMarkup contain the property name of the referenced image blob, CoreMedia recommends not to change the property name. You would need to program a Unified API client to change the current versions of the XmlMarkup properties and there is no trivial way to change older versions. |
Stop the Content Server.
Rename the property in the content types definition file.
Execute the following SQL statement with the declaring content type and all its subtypes:
UPDATE Blobs SET propertyName = 'myNewName' WHERE propertyName='myOldName' AND EXISTS (SELECT * FROM Resources WHERE id_=documentId AND documentType_ IN ('myType', 'mySubtype1', 'mySubtype2',...));
Start the Content Server.
For properties of the type LinkListProperty
, proceed as
follows:
Stop the Content Server.
Rename the property in the content types definition file.
Execute the following SQL statement with the declaring content type and all its subtypes:
UPDATE LinkLists SET propertyName = 'myNewName' WHERE propertyName='myOldName' AND EXISTS (SELECT * FROM Resources WHERE id_=sourceDocument AND documentType_ IN ('myType', 'mySubtype1', 'mySubtype2',...))
Start the Content Server.
For properties of the type IntProperty
or
StringProperty
, proceed as follows:
Stop the Content Server.
Rename the property in the content types definition file.
Rename the database column representing the property in the database tables for the declaring document type and all its subtypes. Depending on the database, this is possible either
using an
ALTER TABLE
statement renaming the column, orby adding a new column using an
ALTER TABLE
statement, copying the data from the old to the new column, and setting the old column toNULL
(for DB2, for example), orby creating a new table, copying all data, and deleting the old table.
Start the Content Server.
For properties of the type DateProperty
, proceed as
follows:
Stop the Content Server.
Rename the property in the content types definition file.
Rename the database column representing the property in the database tables for the declaring document type and all its subtypes, as described in the
IntProperty
/StringProperty
case above.Rename the database column storing the property's time zone, in the database tables representing the declaring document type and all its subtypes. The column name is the property name suffixed with
"_tz"
.Start the Content Server.