-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Database migration to new server #1058
Comments
Hi, You might like to compare select personid, md5(photodata) from person_photo order by personid; Also, plain mysqldump --single-transaction --add-drop-table --routines --events --opt jethro > jethro.sql You should be able to just pipe that SQL to I had a dreadful time migrating Jethro once, and it was due to encodings. IIRC, old MySQL 5.x defaults to If you're sure it wasn't the SQL dump/restore that broke things, then I'd look for error logs relating to the broken image. I don't know about Caddy, but I'd expect to find them in Apache's I've not been brave enough to try Jethro with PHP versions above 7.4. I'd say stick to what worked on the old instance. |
Thanks @jefft
Yep, looks like they were.
Tried this - took the dump, did a find-and-replace of
Context:
Adding a 😊 to a text field on the old Jethro (MariaDB 10.3.39 with PHP 8.0.30) gives me this:
Adding a 😊 to a text field on the new Jethro (freshly setup, without an import) gives me this:
Seems like there may be something wrong with the encodings on both servers... Edit: same error on the new server after downgrading to PHP 7.4 and trying again. |
So you're exporting SQL from MariaDB 10.3.39 and importing into MySQL (not mariadb) 8.4.1? I wonder if If it's not truncation, I'd try - very carefully - restoring the SQL into another database (e.g. You've also got encoding problems, but that shouldn't be breaking SELECT DEFAULT_CHARACTER_SET_NAME FROM information_schema.SCHEMATA where SCHEMA_NAME=DATABASE(); and this will show encodings of individual tables: SELECT T.table_name, CCSA.character_set_name FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA WHERE CCSA.collation_name = T.table_collation AND T.table_schema = DATABASE(); Ideally they should all be |
Alright, it took me a little while to work through this between other things. I've got everything working reliably now, upgrading all encodings to utf8mb4 and handling images/blobs correctly. Export: mysqldump -u <user> --password=<pwd> --single-transaction --add-drop-table --routines --opt --hex-blob jethro > jethro.sql
sed -i -e 's/CHARSET=utf8 /CHARSET=utf8mb4 /g' \
-e 's/CHARSET=utf8mb3/CHARSET=utf8mb4/g' \
-e 's/COLLATE=utf8_general_ci/COLLATE=utf8mb4_general_ci/g' jethro.sql Import:
For Jethro itself to handle emojis correctly, I had to patch https://github.com/tbar0970/jethro-pmm/blob/master/include/jethrodb.php#L53 to connect with |
Thanks for recording the fix here. Yes, the default charset should definitely be |
Hi there,
I'm in the process of moving our Jethro install onto a new server and run into a couple of challenges:
With PHP 8.3.9, I get
"An error occurred. Please contact your system administrator for help."
and this in the logs whenever I perform a search:After downgrading to PHP 8.0.30, search works fine again. I can live with that, but figured it might be a bug worth reporting.
Profile images don't seem to have come across along with the rest of the data. When heading to any profile that has a picture set on the old server, it fails to load on the new server:
I can confirm that there's data in the
person_photo
table, and if I upload a new image as the profile it will display. This I'm stumped on, and would appreciate some help with.Potentially relevant infomation:
I have
define('SQL_MODE', 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION');
in myconf.php
.I did the data import by doing a
mysqldump
on both installs, then combining the table initialisations from the new server with the insert statements from the old server and then running that on the new server. I didn't have any success running the dump from the old server directly/unmodified on the new server.The old server is running on a Raspberry Pi. The new server is running in a container with the configuration below. Both are using Jethro 2.35.1.
Dockerfile
docker-compose.yaml
Caddyfile
Thanks!
The text was updated successfully, but these errors were encountered: