Inhalt
Die Datenbank ist integraler Bestandteil des ChemSelect-Containers, Zugriff mit Account „chemselect“ und gewürfeltem Passwort. Das Passwort herauszufinden ist nicht ganz leicht. Man muss sich in den laufenden Container hängen und sich die Datei /etc/chemselect/config.json angucken:
frankhintsch@cloud:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8024fac197f9 adminer "entrypoint.sh docke…" 6 hours ago Up 6 hours 0.0.0.0:9040->8080/tcp, :::9040->8080/tcp chemselect_adminer_1
e8bc23565f54 chemselect:0.9.4-235 "chemselect" 6 hours ago Up 6 hours 127.0.0.1:9030->443/tcp chemselect_prod
56f8c9aa15f2 chemselect:latest "chemselect" 6 hours ago Up 6 hours 127.0.0.1:9020->443/tcp chemselect_test
320c88e42391 openproject/community:12 "./docker/prod/entry…" 17 months ago Up 2 months 5432/tcp, 127.0.0.1:8080->80/tcp compose_proxy_1
8e2cc6e8da59 openproject/community:12 "./docker/prod/entry…" 17 months ago Up 2 months (healthy) 80/tcp, 5432/tcp compose_web_1
e0d8978e7dfd openproject/community:12 "./docker/prod/entry…" 17 months ago Up 2 months 80/tcp, 5432/tcp compose_cron_1
590e6c68ac8a openproject/community:12 "./docker/prod/entry…" 17 months ago Up 2 months 80/tcp, 5432/tcp compose_worker_1
1a24f7f6cc6d postgres:13 "docker-entrypoint.s…" 17 months ago Up 2 months 5432/tcp compose_db_1
ca96862044f6 memcached "docker-entrypoint.s…" 17 months ago Up 2 months 11211/tcp compose_cache_1
frankhintsch@cloud:~$ docker exec -it chemselect_test bash
root@test:/app# cat /etc/chemselect/config.json
{
"Database": {
"Server": "localhost",
"Name": "chemselect",
"User": "chemselect",
"Password": "Eiqu6eep3u"
}
}
root@test:/app#
Und dann mit adminer:
Datenbank sichern
Die User Datenbank (SQLite) kann als Volume gesichert werden.
Export mit adminer:
ergibt dann so eine SQL -Datei:
-- Adminer 4.8.1 MySQL 5.5.5-10.10.2-MariaDB-1:10.10.2+maria~ubu2204 dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
USE `chemselect`;
SET NAMES utf8mb4;
INSERT INTO `Mixture` (`Id`, `UserId`, `MixtureName`, `RoleId`, `Evaluation_PC`, `Evaluation_PriorityLists`, `ArticleNumber`, `SupplierId`, `IsChanged`, `IsSelected`, `Evaluation_Substitution`, `Evaluation_Substitution_Availability`, `Evaluation_Substitution_Characteristics`, `Substitution_Availability`, `Substitution_ChemicalProperties`, `Substitution_Integration`, `Substitution_NumberOfSubstances`, `Substitution_Requirement`, `Substitution_Specific`) VALUES
('08db77e4-b66f-4f3b-82d3-fd0945aef09a', '54ed4e48-2ef2-44ff-8d54-0cc25063dd44', 'Bleifarbe', 1, 1, 3, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('08dbc365-ab32-420b-8657-8416658c0f4d', '54ed4e48-2ef2-44ff-8d54-0cc25063dd44', 'orochemie WC-Reiniger', 1, 3, 3, NULL, '08dc1f56-b5e4-4ca7-82a4-6192f1793393', 0, 1, 3, 3, 3, 720003, 725004, 722003, 721004, 723004, 724004),
('08dc1104-7323-4d76-8549-8f552f2b2f7f', '54ed4e48-2ef2-44ff-8d54-0cc25063dd44', 'Papier mit Additiven', 0, 1, 5, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
Restore
Die Wiederherstellung kann auch mit adminer gemacht werden.
Bei den Sqlite Volumes darauf achten, dass die Zugriffsrechte passen:
root@cloud:/var/lib/docker/volumes/chemselect_identityP/_data# ls -la .
total 140
drwxr-xr-x 2 systemd-network root 4096 Mai 28 19:54 .
drwx-----x 3 root root 4096 Apr 5 2023 ..
-rw-r--r-- 1 systemd-network root 135168 Mai 16 19:25 identity.db