Turning Resourcespace into a Docker.

Leave a comment

May 25, 2020 by aubreykloppers

The following steps was done to migrate OpenMediaVault 4, with native Resourcespace and MariaDB plugin, to OpenMediaVault 5 and Resourcespace and MariaDB into Dockers.

  1. Backup resourcespace config.php (IMPORTANT for the scramble_key)
  2. Backup MYSQL: 
    1. mysqldump –all-databases > full-backup-$(date +%F).sql -u root -p
  3. in UI: disable nginx
  4. in UI: disable mysql
  5. in UI: uninstall mysql
  6. apt-get update
  7. in UI: enable and install docker
  8. mv /etc/mysql old
  9. mkdir /bin/old; mv mysql* old
  10. apt-get autoremove
  11. enable docker plugin
  12. install mariadb docker with tag 10.1
  13. docker run –restart=always –name=mysql –network=host -e MYSQL_ROOT_PASSWORD=password -d mariadb:10.1
  14. docker exec -i mysql mysql -uroot -ppassword < /root/full-backup-2020-05-18.sql
  15. install resourcespace docker (https://github.com/creecros/resourcespace-docker)
  16. recover config.php
  17. in Resourcespace: run config
  18. replaced scramble key and reloaded

To remove all traces of mysql I did the following:

  • rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
  •   513  updatedb
  •   514  dpkg -l | grep mysql
  •   515  sudo apt-get purge mysql-common
  •   516  dpkg -l | grep mysql
  •   517  sudo apt-get purge libmysqlclient18:amd64
  •   518  sudo apt-get purge mysql-server-5.5
  •   519  dpkg -l | grep mysql
  •   520  sudo apt-get purge php5-mysqlnd
  •   521  apt-get remove –purge *mysql\*
  •   522  apt-get autoremove
  •   523  apt-get autoclean
  •   525  apt-get update
  •   526  apt-get upgrade
  •   527  rm -rf /var/lib/mysql-files/
  • reboot

— UPGRADE —

  1. apt-get autoremove

 # Change Debian repos

  1. sed -i “s/stretch/buster/g” /etc/apt/sources.list
  2. sed -i “s/stretch/buster/g” /etc/apt/sources.list.d/*
  3. sed -i “s/arrakis/usul/g” /etc/apt/sources.list.d/*
  4. sed -i “/[Dd]ocker/d” /etc/apt/sources.list.d/omv-extras-org.list
  5. rm -f /etc/apt/apt.conf

# Debian and OMV update (keep existing configurations)

  1. wget -O “/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc” https://packages.openmediavault.org/public/archive.key
  2. apt-key add “/etc/apt/trusted.gpg.d/openmediavault-archive-keyring.asc”
  3. apt-get update && apt-get dist-upgrade
  4. apt-get autoclean
  5. reboot

  # PORTAINER/DOCKER

  1. removed proxy from /etc/apt/apt.conf.d/99…proxy
  2. apt-get update
  3. apt-get upgrade
  4. installed Docker and Portainer in OMV
  5. take snapshot

 # upgraded mariadb to latest in Portainer

  1. docker pull mariadb:10.2
  2. update (through portainer duplication) from 10.1 to 10.2 – success
  3. docker pull mariadb:10.3
  4. update (through portainer duplication) from 10.2 to 10.3 – success
  5. docker pull mariadb:10.4
  6. update (through portainer duplication) from 10.3 to 10.4 – success

Note: resolv.conf issue: Created a cron entry in UI to run at reboot overriding the file with my own custom file.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: