• [SOLVED] Fail to restore MySQL dump

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #52548  by LauryMenton
 
Hello, I'm trying to restore the dump, as explained in the official doc, but it fails.

I can create the dump and create user without errors, but when I try to restore the DB into the new (blank) DB, it shows me a 'TTY' error:
Some like: "The input device is not a TTY".

I tried, as shown somewhere, with:
Code: Select all
docker-compose exec -it CONTAINER_ID mysql -h 127.0.0.1 -u root -popenkm okmdb < /mnt/user/BACKUPS/Docker/OpenKM/MYSQL_DB/okmdb_bkp.sql
Now the console doesn't show any error. It just finishes. But when I take a look inside the restored DB, nothing is there. The DB stills blank. So, the command doesn't restore the dump.

The error appears when I try to run the following command, as described in the official doc (adapted to work with docker container):
Code: Select all
docker exec -it CONTAINER_ID mysql -h 127.0.0.1 -u root -popenkm okmdb < /mnt/user/BACKUPS/Docker/OpenKM/MYSQL_DB/okmdb_bkp.sql
I create the DB dump using the following command (it works perfectly, after checking the file):
Code: Select all
docker exec -it CONTAINER_ID mysqldump -h 127.0.0.1 -u root -popenkm okmdb > /mnt/user/BACKUPS/Docker/OpenKM/MYSQL_DB/okmdb_bkp.sql
Last edited by LauryMenton on Wed Jul 07, 2021 7:07 am, edited 2 times in total.
 #52551  by pavila
 
I think you can try any of these commands:
Code: Select all
cat /tmp/sample.sql | docker exec -i CONTAINER_ID mysql
or
Code: Select all
docker exec -i CONTAINER_ID mysql < /tmp/sample.sql
But if none of these options work, this is a Docker question and you should ask in a Docker forum.
 #52584  by LauryMenton
 
Thank you for your reply, but it was failing because a 'warning' msg was written into the DB, maybe, for debbuging purposes.

So, after deleting that line (nº 1) from the DB dump file, the DB was restored succesfully.

Image
 #52594  by jllort
 
thanks for sharing. Anyway, this error is quite strange because the two characters "-- " is the standard comment for MySQL line and should not be considered in any manner. I suggest sharing the issue with MySQL or MariaDB guys because it seems like a bug.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.