Comparing versions
Version 1Current version
This page contains information on how to convert from databases such as tikiwiki to bitweaver.

Upgrade Gotcha's

  • You may need to increase your PHP.INI memory_limit value (up to 64M or more) and max_execution_time (to 180 seconds or more) during upgrades of large sites
  • Don't forget to reimport your customised styles into the themes/styles directory of the new installation
  • Don't forget to confirm your start page during the installation

Generic Database Upgrades / Conversions

bitweaver has a powerfull yet simple upgrader that is part of the InstallPackage. With a single click you can give your old site the power of bitweaver.

Our architecture for upgrading, like all of bitweaver, is modular and powerful. Every BitweaverPackage maintains its own upgrade script. This architecture enables you to upgrade *any* CMS to *any* bitweaver version. Anyone up for a drupal upgrader? *nuke upgrader? TW1.9 upgrader?

Currently it handles TikiWiki 1.8 and bitweaver ReleaseZero updates. It uses a lot of subselects so you will need a real database or at least MySQL 4.1.

How does it work?

install/upgrade.php does all the magic by looking at every BitweaverPackage's <package>/admin/upgrade_inc.php. This file has upgrade hashes of SQL *and* php for each package version and particular RDBMS as necessary. Below is a brief example. We suggest you look at liberty/admin/upgrade_inc.php if you are interested in seeing a complete example of how it works, or shoutbox/admin/upgrade_inc.php for a simpler example.


<?php
$updateHash 
= array(

'TW18' => array(
    
'2.0' => array(
          
'pgsql' => 'ALTER TABLE tiki_pages RENAME `pageId` TO `page_id`'
    
)
),

'2.0' => array(
    
'3.0' => array(
          
'sql92' => "ALTER TABLE tiki_pages ADD foo VARCHAR(20); UPDATE tiki_pages SET foo='bar';",
           
'php' => 'foreach( $hash as $key ) { doSomething(); } '
     
)
)

);
?>


</package>
 
This page contains information on how to convert from databases such as tikiwiki to bitweaver.

Upgrade Gotcha's

  • You may need to increase your PHP.INI memory_limit value (up to 64M or more) and max_execution_time (to 180 seconds or more) during upgrades of large sites
  • Don't forget to reimport your customised styles into the themes/styles directory of the new installation
  • Don't forget to confirm your start page during the installation

Generic Database Upgrades / Conversions

bitweaver has a powerfull yet simple upgrader that is part of the InstallPackage. With a single click you can give your old site the power of bitweaver.

Our architecture for upgrading, like all of bitweaver, is modular and powerful. Every BitweaverPackage maintains its own upgrade script. This architecture enables you to upgrade *any* CMS to *any* bitweaver version. Anyone up for a drupal upgrader? *nuke upgrader? TW1.9 upgrader?

Currently it handles TikiWiki 1.8 and bitweaver ReleaseZero updates. It uses a lot of subselects so you will need a real database or at least MySQL 4.1.

How does it work?

install/upgrade.php does all the magic by looking at every BitweaverPackage's <package>/admin/upgrade_inc.php. This file has upgrade hashes of SQL *and* php for each package version and particular RDBMS as necessary. Below is a brief example. We suggest you look at liberty/admin/upgrade_inc.php if you are interested in seeing a complete example of how it works, or shoutbox/admin/upgrade_inc.php for a simpler example.


<?php
$updateHash 
= array(

'TW18' => array(
    
'2.0' => array(
          
'pgsql' => 'ALTER TABLE tiki_pages RENAME `pageId` TO `page_id`'
    
)
),

'2.0' => array(
    
'3.0' => array(
          
'sql92' => "ALTER TABLE tiki_pages ADD foo VARCHAR(20); UPDATE tiki_pages SET foo='bar';",
           
'php' => 'foreach( $hash as $key ) { doSomething(); } '
     
)
)

);
?>


some examples of what is available:

datadict


<?php
// create new tables
// 'CREATE':
    
array( 'CREATE' => array (
        
'tiki_article_status' => "
            status_id    I4 PRIMARY,
            status_name C(64)
        "
,
    )),
// add columns to tables
// 'ALTER':
    
array( 'ALTER' => array(
        
'tiki_articles' => array(
            
'content_id' => array( '`content_id`''I4' ),
            
'description' => array( '`description`''X' ),
            
'status_id' => array( '`status_id`''I4' ),
            
'image_attachment_id' => array( '`image_attachment_id`''I4' ),
            
'article_type_id' => array( '`article_type_id`''I4' ),
        ),
        
'tiki_article_types' => array(
            
'article_type_id' => array( '`article_type_id`''I4' ),
        ),
        
'tiki_article_topics' => array(
            
'has_topic_image' => array( '`has_topic_image`''VARCHAR(1)' ),
        ),
    )),
// rename existing tables
// 'RENAMETABLE':
    
array( 'RENAMETABLE' => array(
        
'tiki_articles' => 'articles',
        
'tiki_article_status' => 'article_status',
        
'tiki_article_types' => 'article_types',
        
'tiki_article_topics' => 'article_topics',
    )),
// rename columns in tables
// 'RENAMECOLUMN':
    
array( 'RENAMECOLUMN' => array(
        
'article_topics' => array(
            
'`active`' => 'active_topic'
        
),
    )),
// rename a sequence
// 'RENAMESEQUENCE':
    
array( 'RENAMESEQUENCE' => array(
        
"tiki_article_topics_topic_id_seq" => "article_topics_t_id_seq",
        
"tiki_article_types_topic_id_seq" => "article_types_t_id_seq",
        
"tiki_article_article_id_seq" => "article_article_id_seq",
    )),
// drop a column from an existing table
// 'DROPCOLUMN':
    
array( 'DROPCOLUMN' => array(
        
'tiki_submissions' => array( '`bibliographical_references`' ),
    )),
// drop an existing table
// 'DROPTABLE':
    
array( 'DROPTABLE' => array(
        
'tiki_content'
    
)),
// create an index
// 'CREATEINDEX':
    
array( 'CREATEINDEX' => array(
        
'tiki_content_title_idx' => array( 'tiki_content''`title`', array() ),
        
'tiki_content_user_idx' => array( 'tiki_content''`user_id`', array() ),
        
'tiki_content_moduser_idx' => array( 'tiki_content''`modifier_user_id`', array() ),
        
'tiki_content_hits_idx' => array( 'tiki_content''`hits`', array() ),
        
'tiki_comments_content_idx' => array( 'tiki_comments''`content_id`', array() ),
        
'tiki_struct_user_idx' => array( 'tiki_structures''`user_id`', array() ),
        
'tiki_struct_root_idx' => array( 'tiki_structures''`root_structure_id`', array() ),
        
'tiki_struct_content_idx' => array( 'tiki_structures''`content_id`', array() ),
    )),
?>


query


<?php
// allows you to execute SQL direclty, like updates and the like. if your
// SQL is different for different DBs, you can restrict it using the following:
    // 'MYSQL' :
    // 'PGSQL' :
    // 'SQL92' :
        
"UPDATE `".BIT_DB_PREFIX."tiki_comments` SET `objectType`='".BITARTICLE_CONTENT_TYPE_GUID."' WHERE `objectType`='articles'",
?>


php


<?php
// allows you to simply pass PHP strings to the upgrader. this gives you
// unlimited control over what can be done in the upgrader. you can copy
// files and do all sorts of cool stuff this way
    
' global $gBitSystem;
    require_once( ARTICLES_PKG_PATH."BitArticle.php" );

    // BitArticle has 3 sequences, each needs creating prior to execution
    $max_articles = $gBitSystem->mDb->getOne( "SELECT MAX(`article_id`) FROM `'
.BIT_DB_PREFIX.'tiki_articles`" );
    $gBitSystem->mDb->CreateSequence( "tiki_articles_article_id_seq", $max_articles + 1 );
    $max_topics = $gBitSystem->mDb->getOne( "SELECT MAX(`topic_id`) FROM `'
.BIT_DB_PREFIX.'tiki_article_topics`" );
    $gBitSystem->mDb->CreateSequence( "tiki_article_topics_topic_id_seq", $max_topics + 1 );
    $max_types = $gBitSystem->mDb->getOne( "SELECT MAX(`article_type_id`) FROM `'
.BIT_DB_PREFIX.'tiki_article_types`" );
    $gBitSystem->mDb->CreateSequence( "tiki_article_types_article_type_id_seq", $max_types + 1 ); '
?>


The best way to get a feel for the upgrader is by looking at existing upgrade_inc.php files
</package>
Page History
Date/CommentUserIPVersion
18 May 2008 (20:35 UTC)
laetzer85.178.10.624
Current • Source
xing194.152.164.452
View • Compare • Difference • Source
xing194.152.164.451
View • Compare • Difference • Source