How I Migrated Wiki from Centos 6 to Centos 7: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created page with "== 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 [https://www.me...")
 
No edit summary
Line 7: Line 7:
Location: /local2/wiki/mediawiki
Location: /local2/wiki/mediawiki


=== Introduction ===
=== Instructions ===
# Install LAMP Stack then install MediaWiki ([https://www.tecmint.com/install-mediawiki-on-centos-7/ Guide] follow till step 8)
# Install LAMP Stack then install MediaWiki ([https://www.tecmint.com/install-mediawiki-on-centos-7/ Guide] follow till step 8)
#* yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
#* yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
Line 21: Line 21:
#* systemctl enable mariadb
#* systemctl enable mariadb
#* mysql_secure_installation
#* mysql_secure_installation
#**  Make Mariadb root user/pass
#*** root
#*** cluster2 password based on vav
#* systemctl restart httpd
#* systemctl restart httpd
#* cd /var/www/html
#* cd /var/www/html
Line 26: Line 29:
#* tar xf  mediawiki*.tar.gz  
#* tar xf  mediawiki*.tar.gz  
#* mv mediawiki-1.32.0/* /<directory of where you want to store wiki files>
#* mv mediawiki-1.32.0/* /<directory of where you want to store wiki files>
#* Mariadb root user/pass
#** root
#** cluster2 password based on vav
# Make LocalSettings.php
# Make LocalSettings.php
#* One way is to copy the old one and fix the information
#* One way is to copy the old one and fix the information
#* Second way is to do
#* Second way is to do
#** php <path to wiki directory>/maintenance/install.php <options>
#** php <path to wiki directory>/maintenance/install.php <options>
#*** Example: php maintenance/install.php DIZI admin --pass=GPCRxtal1! --dbuser=root --dbpass=<cluster2 root password>
#*** 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
#* Always make sure that the information on LocalSettings.php are correct
# systemctl restart httpd sometimes helped
# Check HTTPD config
#* vim /etc/httpd/conf.d/wiki.conf
#** Make sure that the DocumentRoot is pointing at the right directory
# systemctl restart httpd //sometimes helped
 
 
== Server side of Wiki in Vav ==
=== Instructions ===
# In the original wiki machine (in this case it was rho), backup mysql schema by running the command “automysqlbackup”
#* [https://www.interserver.net/tips/kb/configure-automysql-backup-centos/ Here's a guide on how to install autosqlbackup on Centos and how to do an automatic/manual backup]
# After the back up, then do a mysqldump to get all existing databases on rho ([https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html Guide])
#* The command I used since I did alldatabases is
#** mysqldump -u root -p --alldatabases > dump.sql
# Copy over dump.sql to new server
# Import the database backup ([https://www.mediawiki.org/wiki/Manual:Restoring_a_wiki_from_backup#Import_the_database_backup Guide])
#* The command I used since I did all databases is
#** mysql -u root -p < dump.sql
# Run wiki's update script
#* php <path to wiki client side>/maintenance/update.php
# 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.
# systemctl restart mariadb //sometimes helped

Revision as of 00:14, 28 October 2021

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


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