alter table SYSPARAMETERS
   add context_key varchar(128);
alter table SYSPARAMETERS
   alter column name_key type varchar(128);
alter table SYSPARAMETERS
   alter column descr_key type varchar(128);

update SYSPARAMETERS
       set context_key = 'sysparam.context.archive',
       	   name_key = 'sysparam.context.archive.cleaningperiod',
           descr_key = 'sysparam.context.archive.cleaningperiod.descr'
where context = 'ARCHIVE' and name = 'CleaningPeriod';

update SYSPARAMETERS
       set context_key = 'sysparam.context.archive',
       	   name_key = 'sysparam.context.archive.minimumage',
           descr_key = 'sysparam.context.archive.minimumage.descr'
where context = 'ARCHIVE' and name = 'MinimumAge';

update SYSPARAMETERS
       set context_key = 'sysparam.context.archive',
       	   name_key = 'sysparam.context.archive.startbackuphour',
           descr_key = 'sysparam.context.archive.startbackuphour.descr'
where context = 'ARCHIVE' and name = 'StartBackupHour';

update SYSPARAMETERS
       set context_key = 'sysparam.context.archive',
       	   name_key = 'sysparam.context.archive.endbackuphour',
           descr_key = 'sysparam.context.archive.endbackuphour.descr'
where context = 'ARCHIVE' and name = 'EndBackupHour';

update SYSPARAMETERS
       set context_key = 'sysparam.context.archivecategory',
       	   name_key = 'sysparam.context.archivecategory.enablearchivecategory',
           descr_key = 'sysparam.context.archivecategory.enablearchivecategory.descr'
where context = 'ARCHIVECATEGORY' and name = 'EnableArchiveCategory';

update SYSPARAMETERS
       set context_key = 'sysparam.context.archivecategory',
       	   name_key = 'sysparam.context.archivecategory.archivecategorypath',
           descr_key = 'sysparam.context.archivecategory.archivecategorypath.descr'
where context = 'ARCHIVECATEGORY' and name = 'ArchiveCategoryPath';

update SYSPARAMETERS
       set context_key = 'sysparam.context.categoryview',
       	   name_key = 'sysparam.context.categoryview.enablecountcatdocs',
           descr_key = 'sysparam.context.categoryview.enablecountcatdocs.descr'
where context = 'CATEGORYVIEW' and name = 'EnableCountCatDocs';

update SYSPARAMETERS
       set context_key = 'sysparam.context.categoryview',
       	   name_key = 'sysparam.context.categoryview.showdisplayascii',
           descr_key = 'sysparam.context.categoryview.showdisplayascii.descr'
where context = 'CATEGORYVIEW' and name = 'ShowDisplayAscii';

update SYSPARAMETERS
       set context_key = 'sysparam.context.categoryview',
       	   name_key = 'sysparam.context.categoryview.listaccessiblecategoriesonly',
           descr_key = 'sysparam.context.categoryview.listaccessiblecategoriesonly.descr'
where context = 'CATEGORYVIEW' and name = 'ListAccessibleCategoriesOnly';

update SYSPARAMETERS
       set context_key = 'sysparam.context.categoryview',
       	   name_key = 'sysparam.context.categoryview.listtitels',
           descr_key = 'sysparam.context.categoryview.listtitels.descr'
where context = 'CATEGORYVIEW' and name = 'ListTitels';

update SYSPARAMETERS
       set context_key = 'sysparam.context.document',
       	   name_key = 'sysparam.context.document.enabledocumentstatuscoverage',
           descr_key = 'sysparam.context.document.enabledocumentstatuscoverage.descr'
where context = 'DOCUMENT' and name = 'EnableDocumentStatusCoverage';

update SYSPARAMETERS
       set context_key = 'sysparam.context.document',
       	   name_key = 'sysparam.context.document.enabledocumentclasscoverage',
           descr_key = 'sysparam.context.document.enabledocumentclasscoverage.descr'
where context = 'DOCUMENT' and name = 'EnableDocumentClassCoverage';

update SYSPARAMETERS
       set context_key = 'sysparam.context.functionalview',
       	   name_key = 'sysparam.context.functionalview.functionalviewrootcategoryid',
           descr_key = 'sysparam.context.functionalview.functionalviewrootcategoryid.descr'
where context = 'FUNCTIONALVIEW' and name = 'FunctionalViewRootCategoryId';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.accesslogfile',
           descr_key = 'sysparam.context.logging.accesslogfile.descr'
where context = 'LOGGING' and name = 'AccessLogFile';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.serverlogfile',
           descr_key = 'sysparam.context.logging.serverlogfile.descr'
where context = 'LOGGING' and name = 'ServerLogFile';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.infologfile',
           descr_key = 'sysparam.context.logging.infologfile.descr'
where context = 'LOGGING' and name = 'InfoLogFile';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.errorlogfile',
           descr_key = 'sysparam.context.logging.errorlogfile.descr'
where context = 'LOGGING' and name = 'ErrorLogFile';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.tracelogfile',
           descr_key = 'sysparam.context.logging.tracelogfile.descr'
where context = 'LOGGING' and name = 'TraceLogFile';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.maxlogfilecount',
           descr_key = 'sysparam.context.logging.maxlogfilecount.descr'
where context = 'LOGGING' and name = 'MaxLogFileCount';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.maxlogfilesize',
           descr_key = 'sysparam.context.logging.maxlogfilesize.descr'
where context = 'LOGGING' and name = 'MaxLogFileSize';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.enablelogging',
           descr_key = 'sysparam.context.logging.enablelogging.descr'
where context = 'LOGGING' and name = 'EnableLogging';

update SYSPARAMETERS
       set context_key = 'sysparam.context.logging',
       	   name_key = 'sysparam.context.logging.logginglevel',
           descr_key = 'sysparam.context.logging.logginglevel.descr'
where context = 'LOGGING' and name = 'LoggingLevel';

update SYSPARAMETERS
       set context_key = 'sysparam.context.login',
       	   name_key = 'sysparam.context.login.enableuserregistration',
           descr_key = 'sysparam.context.login.enableuserregistration.descr'
where context = 'LOGIN' and name = 'EnableUserRegistration';

update SYSPARAMETERS
       set context_key = 'sysparam.context.login',
       	   name_key = 'sysparam.context.login.enableguestlogin',
           descr_key = 'sysparam.context.login.enableguestlogin.descr'
where context = 'LOGIN' and name = 'EnableGuestLogin';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.adminemail',
           descr_key = 'sysparam.context.mail.adminemail.descr'
where context = 'MAIL' and name = 'AdminEmail';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.mailserver',
           descr_key = 'sysparam.context.mail.mailserver.descr'
where context = 'MAIL' and name = 'MailServer';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.rooturl',
           descr_key = 'sysparam.context.mail.rooturl.descr'
where context = 'MAIL' and name = 'RootURL';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.deletedocumentperiod',
           descr_key = 'sysparam.context.mail.deletedocumentperiod.descr'
where context = 'MAIL' and name = 'DeleteDocumentPeriod';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.checkexpirationtime',
           descr_key = 'sysparam.context.mail.checkexpirationtime.descr'
where context = 'MAIL' and name = 'CheckExpirationTime';

update SYSPARAMETERS
       set context_key = 'sysparam.context.mail',
       	   name_key = 'sysparam.context.mail.enablemail',
           descr_key = 'sysparam.context.mail.enablemail.descr'
where context = 'MAIL' and name = 'EnableMail';

update SYSPARAMETERS
       set context_key = 'sysparam.context.projectmanagement',
       	   name_key = 'sysparam.context.projectmanagement.enableprojectmanagement',
           descr_key = 'sysparam.context.projectmanagement.enableprojectmanagement.descr'
where context = 'PROJECTMANAGEMENT' and name = 'EnableProjectManagement';

update SYSPARAMETERS
       set context_key = 'sysparam.context.projectmanagement',
       	   name_key = 'sysparam.context.projectmanagement.projectrootcategoryid',
           descr_key = 'sysparam.context.projectmanagement.projectrootcategoryid.descr'
where context = 'PROJECTMANAGEMENT' and name = 'ProjectRootCategoryId';

update SYSPARAMETERS
       set context_key = 'sysparam.context.projectmanagement',
       	   name_key = 'sysparam.context.projectmanagement.templatesrootcategoryid',
           descr_key = 'sysparam.context.projectmanagement.templatesrootcategoryid.descr'
where context = 'PROJECTMANAGEMENT' and name = 'TemplatesRootCategoryId';

update SYSPARAMETERS
       set context_key = 'sysparam.context.quota',
       	   name_key = 'sysparam.context.quota.enablequotachecking',
           descr_key = 'sysparam.context.quota.enablequotachecking.descr'
where context = 'QUOTA' and name = 'EnableQuotaChecking';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbname',
           descr_key = 'sysparam.context.systeminfo.dbname.descr'
where context = 'SYSTEMINFO' and name = 'DBName';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbms',
           descr_key = 'sysparam.context.systeminfo.dbms.descr'
where context = 'SYSTEMINFO' and name = 'DBMS';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbcopyright',
           descr_key = 'sysparam.context.systeminfo.dbcopyright.descr'
where context = 'SYSTEMINFO' and name = 'DBCopyright';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbversionhigh',
           descr_key = 'sysparam.context.systeminfo.dbversionhigh.descr'
where context = 'SYSTEMINFO' and name = 'DBVersionHigh';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbversionlow',
           descr_key = 'sysparam.context.systeminfo.dbversionlow.descr'
where context = 'SYSTEMINFO' and name = 'DBVersionLow';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systeminfo',
       	   name_key = 'sysparam.context.systeminfo.dbcreationdate',
           descr_key = 'sysparam.context.systeminfo.dbcreationdate.descr'
where context = 'SYSTEMINFO' and name = 'DBCreationDate';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systempaths',
       	   name_key = 'sysparam.context.systempaths.datastoredir',
           descr_key = 'sysparam.context.systempaths.datastoredir.descr'
where context = 'SYSTEMPATHS' and name = 'DatastoreDir';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systempaths',
       	   name_key = 'sysparam.context.systempaths.searchindexdir',
           descr_key = 'sysparam.context.systempaths.searchindexdir.descr'
where context = 'SYSTEMPATHS' and name = 'SearchIndexDir';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systempaths',
       	   name_key = 'sysparam.context.systempaths.classifyindexdir',
           descr_key = 'sysparam.context.systempaths.classifyindexdir.descr'
where context = 'SYSTEMPATHS' and name = 'ClassifyIndexDir';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systempaths',
       	   name_key = 'sysparam.context.systempaths.converterdir',
           descr_key = 'sysparam.context.systempaths.converterdir.descr'
where context = 'SYSTEMPATHS' and name = 'ConverterDir';

update SYSPARAMETERS
       set context_key = 'sysparam.context.systempaths',
       	   name_key = 'sysparam.context.systempaths.languagedir',
           descr_key = 'sysparam.context.systempaths.languagedir.descr'
where context = 'SYSTEMPATHS' and name = 'LanguageDir';

update SYSPARAMETERS set VALUESTRING = '1'  where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionHigh';
update SYSPARAMETERS set VALUESTRING = '93' where CONTEXT = 'SYSTEMINFO' and name = 'DBVersionLow';
update SYSPARAMETERS set VALUESTRING = '2004-05-11' where CONTEXT = 'SYSTEMINFO' and name = 'DBCreationDate';

commit;

