Can't link to database copied over from 1.7.8 install


#1

I’m in the process of installing 1.8.2 and trying to get the copied over Database from my 1.7.8 install to be recognized in the new version. I’ve done Truncate Log from m,y existing install and copied the file import.sql tothe location var/www/backup

I can get to the xibo login screen but can’t get it to recognize my login credentials from the old database

Followed the steps to set the Database

UPDATE `setting` SET `value`="/var/www/cms/library/", userSee=0, userChange=0 WHERE `setting`="LIBRARY_LOCATION";
UPDATE `setting` SET `value`="tcp://cms-xmr:50001", userSee=0, userChange=0 WHERE `setting`="XMR_ADDRESS";
UPDATE `setting` SET `value`="Apache" WHERE `setting`="SENDFILE_MODE";
exit

I’ve copied the files from my old install to the location var/www/cms/library.
The new install has put files in the location opt/xibo/shared/cms/library

My Database is showing as cms and not the mao-xibo copied over from my old program

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cms                |

My custom ports file is set as (password removed)

version: "2.1"

services:
    cms-db:
        image: mysql:5.6
        volumes:
            - "./shared/db:/var/lib/mysql"
        restart: always
        environment:
            - MYSQL_DATABASE=mao-xibo
            - MYSQL_USER=admin
            - MYSQL_RANDOM_ROOT_PASSWORD=
        mem_limit: 1g
        env_file: config.env
    cms-xmr:
        image: xibosignage/xibo-xmr:release_1.8.2
        ports:
            - "65500:9505"
        restart: always
        mem_limit: 256m
        env_file: config.env
    cms-web:
        image: xibosignage/xibo-cms:release_1.8.2
        volumes:
            - "./shared/cms/custom:/var/www/cms/custom"
            - "./shared/backup:/var/www/backup"
            - "./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom"
            - "./shared/cms/library:/var/www/cms/library"
            - "./shared/cms/web/userscripts:/var/www/cms/web/userscripts"
        restart: always
        links:
            - cms-db:mysql
            - cms-xmr:50001
        environment:
            - XMR_HOST=cms-xmr
        env_file: config.env
        ports:
            - "81:80"
        mem_limit: 1g

#2

I think there’s some confusion over the paths involved.

Lets say your docker-compose files are in /opt/xibo as we suggest.

If so, your database backup file needs to be /opt/xibo/shared/backup/import.sql

There’s no need to try and change the database name. cms is the default and that’s what the system expects with a local database container. What the database was called on your old system is inconsequential.

You need to remove the currently running containers as they are configured in correctly. To do so:

docker-compose -f cms_custom-ports.yml down

Check no containers are left running with

docker ps

Assuming there aren’t, then remove the database container files

rm -r /opt/xibo/shared/db

Now, ensure that your library files from the old CMS are in /opt/xibo/shared/cms/library, not somewhere in /var/www as you suggest.

Now get fresh docker-compose files from the 1.8.3 release (there seems little point in going to 1.8.2 now that 1.8.3 is released, and fixes nearly 100 issues!). Do not edit the database information. It is correct as it is shipped. All you need to edit is the config.env file to ensure you’ve set a password for MySQL, and if you want to use a non-standard set of ports, then copy the cms_custom-ports.yml.template file to cms_custom-ports.yml and edit the webserver or xmr ports as you wish.

Then run

docker-compose -f cms_custom-ports.yml up -d

The old database will be imported and after a time you will be able to log in. Keep in mind that with a large number of layouts, it can take a very long time for the upgrade to run. The upgrade will run to completion before the webserver is started.


#3

Your a Genius!
Yes I was very confused on the location of the files. Too many places to get instructions from and I mixed them all up

Thanks again Alex

Tony