Importing database when switching to 1.8.2 docker installation

We are in the process of switching from a manual installation of 1.8.0-RC2 to a docker installation of 1.8.2.
We have followed this instruction set for switching.
Our existing database is backuped as [xibo-docker-rooturl]/shared/backup/import.sql
Once the containers are running, the database is still empty.

Do we need to manually import this import.sql file into our database ? This is not mentioned in the above instructions ?

Thanks

Ooops, I missed an sql error that is appearing on the xibo-cms url
Fatal Error - sorry this shouldn't happen. SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

It seems that this is an error connecting to the remote MySQL instance running on the same server (we do not use the MySQL container).
I’m investigating access rights, or changing
MYSQL_HOST=localhost MYSQL_PORT=3306
in the config.env file

Keep in mind that MYSQL_HOST is as the container sees things, so “localhost” will be the container itself - not your host machine.

You’ll need to put the host machine’s IP address there not localhost, and also will need to ensure that the MySQL instance running on the host machine is configured to listen for connections from the network (and secure that with a firewall).

If you’re connecting to a remote SQL server with a database that already exists, then there’s no need to do an import either. Just put in the details of your existing Xibo database and the container will use that OK.

Make sure you’re using the remote_mysql docker-compose file, and the remote mysql config.env template as you need those settings for this to work properly, and for a MySQL container to be omitted from the setup.

Since no import process will be run, then you may need to adjust some settings manually - specifically the CMS library path needs to be set to /var/www/cms/library/ and the SENDFILE_MODE setting needs to be set to Apache.

You’ll also need to set the XMR private address to tcp://cms-xmr:50001 and your XMR public address appropriately for your setup, on port 9505 - so for example, tcp://my.server.com:9505

Thanks for the explanation, using docker is pretty new for us (or for lots of Xibo users also). I was already using the remote mysql config.env template.

I foresee a security issue here : the mysql instance running on the server is not accessible from network, in order to protect it.
We can’t use the internal ip address for connecting the xibo-cms container to the mysql instance ?

If we switch back to using the mysql container included, the issue is database storage : when the container is stopped, where is the current database data stored ? In the shared directory ?

You can use an internal IP address, as long as it’s not the loopback interface (as that isn’t shared with the container).

Note in my instructions, I say that you will need to protect the MySQL server with a firewall otherwise.

The easiest option is to use the MySQL container we provide which is totally isolated from all network interfaces, and is only available to the CMS container.

I’ve installed now with the standard containers, including MySQL, and I’m not using remote MySQL.

But the database is still empty, the import.sql in the “shared/backup” directory has not been imported.
Do I need to run it manually ? My understanding was that the importation was done at first upgrade.

Furthermore, we have some custom code (daxplayer). Do I just copy the “custom” directory of my previous installation into the “shared/cms/custom” directory of the docker installation ?

Now, I have this error message when trying to access the cms portal :
Fatal Error - sorry this shouldn’t happen. Unable to find template “error.twig” (looked into: /var/www/cms/modules).

If the file isn’t being moved to import.sql.done, then the import hasn’t been run.

Without seeing it, it’s very hard for me to guess why that could be.

Yes you would put your custom module files in the custom directory, and activate them by adding appropriate configuration to the settings-custom.php file you’ll find in that directory.

It seems that the docker installation can be done properly only with root access / root user on the machine.
There are directories with various owners, such as root, new-relic, www-data, instead of the user launching the docker containers.

For example, i have a custom theme in my current 1.8.0-beta version, and as the “shared/cms/web/theme” directory is owned by root (as the “shared/cms/web”), I can’t copy my existing custom theme in this directory.

Do you confirm that ?

Yes that’s correct. You will need to be a user with superuser permissions, for example root, or with sudo permissions to be able to write in certain parts of the filesystem.

Ok, I understand.
As this is not accepted by our admin, I have to switch to the manual installation instead, without using Docker.

You will still need to be a super user to do a manual installation. The CMS will need to write files as the webserver user, which means you’ll need superuser privileges to maintain those.

Has is changed ? My previous installation, 18.0.0 RC1 was working fine without superuser privileges.

However, I have tried already, and have the same kind of error message at first connection to xibo cms :
Fatal Error - sorry this shouldn’t happen. Unable to find template “error.twig” (looked into: /home/m21dev/www/xibo-cms-1.8.2/modules).

error.twig is in /views, not in /modules, don’t know why it is looking for it in the wrong directory

That has always been the case, right back to Xibo 1.0 series.

It will run fine, but when you need to maintain files that the webserver has created, you won’t be able to in most cases as a normal user - unless the webserver happens to run as the same user you log in as.

Similarly, you’ll need to create system startup tasks for XMR which you won’t be able to do as a normal user. You can run without XMR if you wish, but you do loose some functionality. You will need to access cron as the webserver user to configure XTR.

Ok, so I’ll need to ask my admin to do / run such admin tasks for me.

Is this related the error message I have when I’m trying to upgrade from 18.0 RC1 to 1.8.2, at first connection to XIBO CMS ?

Fatal Error - sorry this shouldn’t happen. Unable to find template “error.twig” (looked into: /home/m21dev/www/xibo-cms-1.8.2/modules).

You’re probably missing your custom modules from the new install, and these are being enabled either in the database or in your settings.php file.

Exact Alex ! I’ve missed the copy of this module, and the update is started now.

This custom module has an impact on step 187 of the update

Add last run start date to tasks
SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘daxpro.task’ doesn’t exist

Do I need to manually create a table in the DB for this module ?

task is not a custom table for the module - it’s there for every CMS install. I can’t comment on why your task table isn’t there, but I would assume it’s because you’re upgrading from a pre-release version which may have custom modifications on it. Dan would have to advise how you would proceed.

Ok, let’s wait for Dan insight.
This have an impact on the displays, none appears in the User Interface, even if there are 3 in the display table itself

How are you in the user interface if you have that error upgrading? Or did you just skip over that step?

If so, I’d advise you restore your pre-upgrade backup and start again. You should not skip steps without understanding why they are not being run properly. Every step is important!