2 of 2 found this page helpful

Migrating from Wik.is to a new MindTouch install

    Overview

    This tutorial walks through the steps of migrating a wik.is installation to a new MindTouch installation.  

    Goal

    After completing this tutorial you will have a new MindTouch installation with your wik.is content.  

    Install MindTouch

    Follow the documentation here on installing a new install of MindTouch.  

    Request Wik.is account backup

    Send an email to wik.is@mindtouch.com from the email account that registered the wik.is site and ask for a backup of your wik.is site.  Make sure you include the name of the wik.is site.  MindTouch will only be able to release the site content to the site owners.  

    The backup will be in the format of a .sql file and a directory of attachments.  Once you have this transfer the files to the new MindTouch server and continue on to the next step.

    Restore MindTouch

    All of the following commands are executed on the new MindTouch server that you setup. Each new line is a new command that should be executed after the previous command has completed.

    Extract the tar.gz file that you have by running the following command (replacing the file.tar.gz with the name of the tar.gz file):

    tar xvpf file.tar.gz

    Restore the MySQL database:

    mysql -uroot -p 
    drop database wikidb;
    create database wikidb default charset utf8;
    exit

    Now import the .sql file that came with your wik.is backup by running the following (replacing the backup.sql with the .sql filename):

    mysql -uroot -p wikidb < backup.sql

    Update Database Values

    Now that the new database is imported, we need to make 2 changes to it to match your environment.  Please select the environment that matches your new MindTouch install:

    (The following commands are run from the MySQL prompt)  Once logged into MySQL make sure you run the following to choose the MindTouch database:

    use wikidb;

    Windows

     

    Check to see if the row exists:

    Select config_key from config where config_key="storage/fs/path";
    Select config_key from config where config_key="storage/type";

    This will return the following if it exists:

    +-----------------+
    | config_key      |
    +-----------------+
    | storage/fs/path |
    +-----------------+
    1 row in set (0.06 sec)
     
     
    +-----------------+
    | config_key      |
    +-----------------+
    | storage/type    |
    +-----------------+
    1 row in set (0.06 sec)If the row does exist run the following:

     

    (note: location of attachments may vary, please confirm before updating the highlighted value below)

    update config set config_value="C:\Program Files\MindTouch\MindTouch\data\files" where config_key="storage/fs/path";
    update config set config_value="fs" where config_key="storage/type";
    
     

    If the row doesn't exist run the following:

    Can you try and run the following from the MySQL command line prompt:
    INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','C:\Program Files\MindTouch\MindTouch\data\files');
    INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');

     

     

    Linux

    Check to see if the row exists:

    Select config_key from config where config_key="storage/fs/path";
    Select config_key from config where config_key="storage/type";
    

    This will return the following if it exists:

    +-----------------+
    | config_key      |
    +-----------------+
    | storage/fs/path |
    +-----------------+
    1 row in set (0.06 sec)
    +-----------------+
    | config_key      |
    +-----------------+
    | storage/type |
    +-----------------+
    1 row in set (0.06 sec)If the row does exist run the following:

    (note: location of attachments may vary, please confirm before updating the highlighted value below)

    update config set config_value="/var/www/dekiwiki/attachments" where config_key="storage/fs/path";
    update config set config_value="fs" where config_key="storage/type";

     

    If the row doesn't exist run the following:

    Can you try and run the following from the MySQL command line prompt:
     
    INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','/var/www/dekiwiki/attachments');
    INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');

    Restore Attachments

    Move the contents of the wik.is attachments directory and copy it to the Windows or Linux attachment locations.

    Run DB update script

    Next run the DB update script by selecting your deployment:

    Windows

    (note: this is run from the Windows command line)

    cd C:\Program Files\MindTouch\MindTouch\web\maintenance
    "C:\Program Files\MindTouch\MindTouch\redist\php\php.exe" update-db.php

    Linux

    Now change directory to /var/www/dekiwiki/maintenance, and run the following:
    php update-db.php

     

    Restart MindTouch

    Now restart MindTouch

    Windows

    Restart the Mindtouch site in IIS

    Linux

    /etc/init.d/dekiwiki restart

     

    Verify

    Load your MindTouch installation and verify that all of the content is there

    Rebuild Search index

    Go into the Control Panel -> Cache Management -> Rebuild Search Index

     

    What's Next

    If you encounter any issues with your upgrade please contact MindTouch support.  You will need a commercial support plan in order to receive assistance with the migration.

    Was this page helpful?
    Tag page
    Viewing 1 of 1 comments: view all
    I found a problem with these instructions that makes links to all attachment files broken because they were not migrated (renamed) properly by the update-db.php script.

    The problem is at the step where I am asked to "Check to see if the row exists" by issuing this SQL statement: "Select config_key from config where config_key="storage/fs/path";

    In my case I found that this select matches no rows, so I followed the branch of the instructions for the case where the row doesn't exist. These instructions are specifically to run these sql commands:
    INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','/var/www/dekiwiki/attachments');
    INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');

    The problem is with the 2nd INSERT INTO... It happens that this table already has a row where config_key='storage/type' but 'config_value'='s3' (apparently from importing the wikidb.sql file from the wik.is dump tarball I recieved).
    The INSERT INTO adds another row where config_key='storage/type' but 'config_value'='fs'. When you later run php update-db.php, the update script detects the 'config_value'='s3' instead of 'config_value'='fs' and it fails to move and rename the files in the attachment directory properly. The new wiki will appear to work, but the links to attachment files do not work because they were not migrated properly by the update-db.php script.

    The fix is to add a step where you check for the existence of the config_key="storage/type" entry and use the update instead of the insert command if it exists to prevent duplicates that breaks the migration script.

    EG:
    Check if row exists using this command: Select config_key from config where config_key="storage/type";

    If it does exist, use this command:
    UPDATE config set config_value="fs" where config_key="storage/type"; and not the command
    If it does not exist, use this command:
    INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');

    This modification resulted in a working wiki migration for me.
    Posted 22:49, 9 Dec 2010
    Viewing 1 of 1 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by