How I Migrated Wiki from Centos 6 to Centos 7

From DISI
Jump to navigation Jump to search

Introduction

The previous wiki existed in a CentOS 6 machine called "rho". Now, it currently exists in a CentOS 7 machine called "vav".

According to the media wiki guide, the safest way to migrate is by using the same MediaWiki version on the new server and perform an upgrade directly on the new server. However, I did not do that. I installed a new version of MediaWiki first and then copied the wiki SQL data into the new version.

Client side of Wiki in Vav

Location: /local2/wiki/mediawiki

Instructions

  1. Install LAMP Stack then install MediaWiki (Guide follow till step 8)
    • yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    • yum install epel-release
    • yum-config-manager --disable remi-php54
    • yum-config-manager --enable remi-php73
    • yum -y install httpd
    • yum -y install mariadb-server mariadb-client
    • yum install php php-mysql php-pdo php-gd php-mbstring php-xml php-intl texlive
    • systemctl start httpd
    • systemctl enable httpd
    • systemctl start mariadb
    • systemctl enable mariadb
    • mysql_secure_installation
      • Make Mariadb root user/pass
        • root
        • cluster2 password based on vav
    • systemctl restart httpd
    • cd /var/www/html
    • wget https://releases.wikimedia.org/mediawiki/1.32/mediawiki-1.32.0.tar.gz
    • tar xf mediawiki*.tar.gz
    • mv mediawiki-1.32.0/* /<directory of where you want to store wiki files>
  2. Make LocalSettings.php
    • One way is to copy the old one and fix the information
    • Second way is to do
      • php <path to wiki directory>/maintenance/install.php <options>
        • Example: php maintenance/install.php DIZI admin --pass=GPCRxtal1! --dbuser=root --dbpass=<vav root password>
    • Always make sure that the information on LocalSettings.php are correct
  3. Check HTTPD config
    • vim /etc/httpd/conf.d/wiki.conf
      • Make sure that the DocumentRoot is pointing at the right directory
  4. systemctl restart httpd //sometimes helped
  5. Based on your /etc/httpd/conf.d/wiki.conf, you can go into the URL and see if it was successful

Server side of Wiki in Vav

Instructions

  1. In the original wiki machine (in this case it was rho), backup mysql schema by running the command “automysqlbackup”
  2. After the back up, then do a mysqldump to get all existing databases on rho (Guide)
    • The command I used since I did alldatabases is
      • mysqldump -u root -p --alldatabases > dump.sql
  3. Copy over dump.sql to new server
  4. Import the database backup (Guide)
    • The command I used since I did all databases is
      • mysql -u root -p < dump.sql
  5. Run wiki's update script
    • php <path to wiki client side>/maintenance/update.php
  6. Maybe it’ll work perfectly maybe not, in my case there were errors which you just have to fix by yourself since the errors might not be the same.
  7. systemctl restart mariadb //sometimes helped
  8. Once your client and server have restarted. Your data should be showing now.

Backup Whole Database

  1. In root directory, "backup_wiki.sh" is executed everyday at 6am via cronjob in "vav".
  2. The backup file is stored at /nfs/exk/wiki_backup/all_wiki_db.sql