Wiki Stuff

    Migration Notes

    • Save the following:
    1. Lisence file
    2. /var/www/dekiwiki
    3. /etc/dekiwiki
    4. /etc/init.d/dekiwiki
    5. /etc/apache2/sites-available/dekiwiki
    6. database (mysqldump -uroot -p**** --add-drop-table wikidb > dekiwikiDBAug2312.sql)
    • The way I migrated this time:
      • install mindtouch on new system using the instructions below with the following changes:
        • for repository in sources.list - change Ubuntu10.04 to 11.04 (more recent may be out)
        • for gs package, use "ghostscript" (renamed)
      • Install it completely including lisence key (I tried to spare the other steps, but didn't work, may have been another reason.  The benefit of doing the whole install + webinstall is that it generates dekiwiki user in mysql with a random password.  You can use that password to paste it into LocalSettings.php and /etc/dekiwiki/...  Not sure if that can be bypassed.)
      • copy files to:
        • /etc/dekiwiki   (and sudo chown -R dekiwiki /etc/dekiwiki)
        • /var/www/dekiwiki (and sudo chown -R dekiwiki /var/www/dekiwiki)
        • sudo chmod 777 /var/www/dekiwiki LocalSettings.php  (for some reason this has wierd permissions settings that causes a white screen in the browser if this isn't done)
        • /etc/apache2/sites-available/dekiwiki
      • Copy dekiwiki mysql password hash from LocalSettings.php and paste it into password fields in new LocalSettings.php and in /etc/dekiwiki/...   (not sure how to skip this step)
      • copy database mysql -uroot -p***** wikidb < backup.sql (I let the webinstaller set up the DB and then pasted the backed-up db, but can probably try to create from scratch to skip the webinstaller step)
      • Restart apache2 (sudo /etc/init.d/apache2 restart) (not sure which should be restarted first, i started dekiwiki first and it gave me error in the terminal on the start command)
      • Restart dekiwiki api script (sudo /etc/init.d/dekiwiki restart)
      • Check if works???
    • Notes:
      • Most problems I had were from permissions
      • At first I installed dekiwiki completely fresh (and then copied db, attachments, skins and bin folders from the old install), but for some reason the search wouldn't work -no results, even if I rebuild search cache.  Then I pasted the entire /var/www/dekiwiki from old install and it worked (after changing chown -R dekiwiki on the whole thing and chmod 777 LocalSettings.php).
        • Not sure why, maybe issue with skins folder that I completely replaced..? I had errors in /var/log/apache2/error-dekiwiki that didn't explain the problem.
      • To get captcha to work: sudo chmod 777 /var/www/dekiwiki/skins/common/cache
        • sudo chmod 777 /var/www/dekiwiki/skins/common/cache/*  (not sure if it's folder or the file that fixed the problem, probably file, could not delete it when making new captchas)

    Migration Document

    Migrating MindTouch from one Linux server to another



    This reviews how to migrate MindTouch from instance to another when MindTouch is installed on Linux on both servers.  


    After completing this tutorial you will have moved the MindTouch install from one server to another.  

    Migrating From One MindTouch Instance To Another

    Install a new instance of MindTouch on the server that you want to migrate to. After installation is complete, edit the LocalSettings.php file located in /var/www/dekiwiki and copy the $wgDBadminpassword value from that so that you can replace it in the files you migrate over.   In the example below we would copy over "password" to use in the files after we migrate.


    $wgDBadminpassword = "password";

    Backing up your database 

    You can do this from command line by issuing the following command:

    # mysqldump -udbusername -p db_name > db_name.sql 

    Note:  If you have a multi-tenant installation of MindTouch, you have multiple databases and will need to back up each database separately.

    Backing up your attachments

    # cd /path/to/dekiwiki/;
    # tar cvzpf attachments.tar.gz attachments

    Backing up Service Storage

    *Note:  This step is deprecated in MindTouch 10.x and newer, and should only be used for version 9.12.3, and below.  As of 10.x, notifications are stored within the database.


    Folders with the name _x002f_ contain service information that is important to MindTouch like page notifications, licensing and other service storage.  Make sure that you back this up and restore it by doing the following

    cd /var/www/dekiwiki/bin
    tar cvzpf serviceinfo.tar.gz _x002f_*

    Move files to new instance

    Copy the backed-up files via scp to the new server:

    # scp /path/to/db_name.sql root@destination.server:/path/to/MindTouch
    # scp /path/to/attachments.tar.gz root@destination.server:/path/to/MindTouch
    # scp /path/to/dekiwiki/LocalSettings.php root@destination.server:/var/www/dekiwiki/
    # scp /etc/dekiwiki/mindtouch.deki.startup.xml root@destination.server:/etc/dekiwiki/
    # scp /etc/dekiwiki/ root@destination.server:/etc/dekiwiki/
    # scp /path/to/serviceinfo.tar.gz root@destination.server:/path/to/MindTouch

    Restoring your database

    First, you will need to drop the default database:

    mysqladmin -udbusername -pdbuserpassword drop db_name;

    Recreate the database, and restore the backup by typing the following commands:

    # mysql -udbusername -pdbuserpassword 
    mysql> create database wikidb default charset utf8;

    Exit mysql, and restore the database by entering the following:

    # mysql -udbusername -p db_name < db_name.sql

    Note: If you have a multi-tenant installation of MindTouch, you have multiple databases and will need to restore each database separately.

    Restoring Service Storage

    *Note:  This step is deprecated in MindTouch 10.x and newer, and should only be used for version 9.12.3, and below.  As of 10.x, notifications are stored within the database.


    Run the following commands to restore page notifications:

    # mv serviceinfo.tar.gz /var/www/dekiwiki/bin

    Then run the following to restore page notifications.

    # tar xvzpf serviceinfo.tar.gz

    Restoring your attachments

    # cd /path/to/deki/;
    # tar xvzpf attachments.tar.gz
    # chown -R dekiwiki /var/www/dekiwiki/attachments 

    If you are running on a MindTouch VMware Virtual Machine then run the following:

    # chown -R www-data /var/www/dekiwiki/attachments 

    Update Config files with wikiuser password

    Now that we have migrated over all of the files from the old server we need to change the database value in the /var/www/dekiwiki/LocalSettings.php file and the /etc/dekiwiki/mindtouch.deki.startup.xml file.  Below you want to take and replace "password" with the wikiuser password from your old install that you copied at the begining of this tutorial.  



    $wgDBadminpassword = "password";



    <db-password hidden="true">password</db-password>


    Update Database

    Now change directory to /var/www/dekiwiki/maintenance, and run the following:

    # php update-db.php


    Rebuild the stored procedures by entering the following command and replacing dbusername and dbuserpassword with your root login credentials:

    *Note:  This step is deprecated in MindTouch 10.x and newer, and should only be used for version 9.12.3, and below.  As of 10.x, notifications are stored within the database.


    # cat /var/www/dekiwiki/maintenance/archives/funcs-util.sql | sed -e 's/{$wgDBadminuser}/wikiuser/' | mysql -udbusername -pdbuserpassword wikidb

    Finally, restart MindTouch:

    # /etc/init.d/dekiwiki restart


    Rebuild Search Index

    After you have migrated your install you'll need to rebuild the search index.  This can be done by going to Control Panel -> Cache Management and then clicking Rebuild Now




    Installing Mindtouch

    Copied from:

    Installing on Ubuntu



    Install MindTouch on Ubuntu using the pre-configured package


    After completing this tutorial you will have successfully installed MindTouch on Ubuntu



    System Requirements (Click to Expand)



    Add the MindTouch repository

    The following commands should be run as "root" (or as a user with root privileges).

    Edit the "/etc/apt/sources.list" file to add the following line (select the version of Ubuntu you are running): 

    Ubuntu 9.04

    deb xUbuntu_9.04/

    Ubuntu 9.10

    deb xUbuntu_9.10/

    Ubuntu 10.04

    deb xUbuntu_10.04/


    Update Repositories

     Type the following command to update your package indexes:

     apt-get update


    Install dependencies packages

    Type the following command to install packages that will enable MindTouch's full functionality:

     apt-get install html2ps poppler-utils html2text wv gs tidy links msttcorefonts cabextract mysql-server

    Note: Installation of some dependencies may require interaction. Answer "yes" to all authentication/verification questions.



    Install/Upgrade Mono (Click to Expand)

    Install PrinceXML

    To enable HTML-to-PDF printing, the static library version of PrinceXML must be installed by entering the following commands:

    32 bit install

      tar -xzvf prince-8.0-linux-static.tar.gz
      cd prince-8.0-linux-static
      sudo ./

    64 bit install 

     tar -xzvf prince-8.0-linux-amd64-static.tar.gz
     cd prince-8.0-linux-amd64-static
     sudo ./

    Hit Enter when asked for the install directory location

    Install MindTouch


    Install MindTouch using the following command : 
     apt-get install mindtouch
    Note: Installation of some dependencies may require interaction. Answer "yes" to all authentication/verification questions.


    Install Trusted Roots Certificates

    Install the trusted roots certificates from the Mozilla LXR website into the Mono certificate store by entering the following:

    apt-get install mono-devel

    Then run the following

     su dekiwiki
    $ mozroots --import --sync
    $ exit

    Configure the Apache Virtual Host

    After the install has finished, edit /etc/apache2/sites-available/dekiwiki and change the ServerName to match the URL that you will be entering into the web browser to arrive at your wiki. This will allow the Apache virtual host to direct traffic to MindTouch.

    Enter the following command to enable MindTouch in Apache and disable the initial default site:

     a2ensite dekiwiki
     a2dissite default

    Once that has been done, enter the following line to reload Apache:

     /etc/init.d/apache2 reload

    Go to "http://your_server/config/index.php" to complete the configuration.


    Web Installer

    When you load the IP address for the MindTouch install it will present you with the following web installer where you can click INSTALL next to the MindTouch product you want to install. In this documentation we will be selecting the MindTouch 2010 installation.



    Attachments Problems

    Proper Permissions

    drwxr-xr-x 2 dekiwiki www-data 4096 Jul 15 16:32 26.res
    drwxr-xr-x 2 dekiwiki www-data 4096 Jul 15 16:33 50.res
    Anyhow It was missing the stored procs for mysql which where wiped when I dropped the new db. I thought I could create a normal blank db with the mysql "create database wikidb" but it turns out you can't and need to use the script...
    So to summarize, when restoring from 1 server to another that are running the same version of the wiki, do the following:
    1> Replace the api security key in the wikidb.sql dump file with the new api from LocalSettings.php
    2> Drop the new wikidb and create a blank db with the script and parse all parameters listed:
    ./ --dbName wikidb --dbAdminUser root --dbAdminPassword password --dbServer localhost --dbWikiUser wikiuser --wikiAdmin Admin --wikiAdminPassword password --wikiAdminEmail test@test.test --storageDir /var/www/deki-hayes/attachments
    3> Then run the update-db.php script and after that import your wikidb.sql dump file.
    4> Extract the attachments etc and do: Chown -R www-data attachements
    In admin interface update fs/path/file (or something like that) to point to attachments


    ./ --dbName wikidb --dbAdminUser root --dbAdminPassword yili --dbServer localhost --dbWikiUser wikiuser --wikiAdmin Admin --wikiAdminPassword windstar --wikiAdminEmail --storageDir /var/www/dekiwiki/attachments

    Tag page (Edit tags)
    • No tags
    Page statistics
    34939 view(s), 8 edit(s) and 23690 character(s)


    You must login to post a comment.

    Attach file