So what I'm trying to do is to simply create backup of my iTOP database via mysqldump.
Why I'm not using the integrated backup solution - because I decided to use external database (the database is not on the same VM as iTOP application)
Can you advice me how I can solve this issue?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With all due respect to the iTop developers, I disagree with the assertion in the ticketing system that this is "not a bug". It is, very much, a bug.
I have just replicated precisely your error, on a brand-new, clean installation of iTop 2.7.3, using the integrated backup feature. I've tried all manner of options on a manual invocation of mysqldump to try to find a combination that will work. The error is due to something in the schema, perhaps a column name, because the error occurs even with "--no-data" specified to back up just the schema, and it occurs with --quote-names.
This was during an attempt to create an initial, baseline backup minutes after finishing the iTop installation wizard, before any data had been populated into the instance.
Installation details: iTop 2.7.3 MariaDB Server 10.3.27 Debian Linux 10.8 PHP 7.3
The eventual goal, once backups are viable, is to migrate the database to our production MariaDB cluster, but for now it is running on the same machine as Apache and iTop.
This is a newly-provisioned, dedicated virtual server that will run nothing but iTop, so the environment is extremely clean other than the prerequisites for iTop and IPAM-for-iTop.
Here is the error:
Error: Failed to execute mysqldump: mysqldump: Couldn't execute 'show create table view_DBServer': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 and SoftwareLicence_softwarelicence_id_Licence.end_date < date_format...' at line 1 (1064)
Creating backup: '/var/www/html/data/backups/manual/itop-2021-03-26_22_19.tar.gz' backup: creating tmp dir '/var/www/html/data/tmp-backup-1312536948' backup: adding resource '/var/www/html/conf/production/config-itop.php' Starting backup of localhost/itop(suffix:'') backup: generate data file with command: mysqldump --defaults-extra-file="/tmp/itop-mysqldump-5mxqph" --opt --skip-lock-tables --default-character-set=utf8mb4 --add-drop-database --single-transaction --host='localhost' --port='3306' --user=xxxxx --result-file='/var/www/html/data/tmp-backup-1312536948/itop-dump.sql' 'itop' mysqldump said: mysqldump: Couldn't execute 'show create table view_DBServer': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 and SoftwareLicence_softwarelicence_id_Licence.end_date < date_format...' at line 1 (1064) Error: Failed to execute: mysqldump --defaults-extra-file="/tmp/itop-mysqldump-5mxqph" --opt --skip-lock-tables --default-character-set=utf8mb4 --add-drop-database --single-transaction --host='localhost' --port='3306' --user=xxxxx --result-file='/var/www/html/data/tmp-backup-1312536948/itop-dump.sql' 'itop' . The command returned:2 Error: mysqldump said: mysqldump: Couldn't execute 'show create table view_DBServer': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 0 and SoftwareLicence_softwarelicence_id_Licence.end_date < date_format...' at line 1 (1064)
With all due respect to the iTop developers, I disagree with the assertion in the ticketing system that this is "not a bug". It is, very much, a bug.
No one ever said that ! I asked to create a discussion so that we can qualify this, in other words understand hwo to reproduce, if a workaround exists, etc.
It's in everyone's best interest to fix bugs in iTop. Having feedbacks from the community is very valuable to us !
And the application history demonstrate that lots of very good things happens thanks to the community : stability, improvements, feedbacks, security, ... (...)
But it is far more easier for us that problems encounters by an iTop user be discussed in the forum first, so that most feedback are obtained, and all the needed information are gathered. Everyone can participate in the forum, almost nobody does in the ticket system.
When we have a clear mind of the problem and know what to change thanks to the discussions in the forum, then we can create a ticket.
👍
2
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That was also my source of misunderstanding, so thank you for clarifying your intent and the reason for referring the issue to the forum. I apologize if my tone was unduly harsh.
❤️
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not able to see the linked wiki page because I do not have an account on the private wiki.
I will assume you are correct, as seems likely, and I will download the new version and install it. Our iTop installation is brand new and not yet production, so I can apply upgrades without disruption to our operations.
I will return here and report the outcome.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have good news. The MariaDB upgrade fixes the problem here.
MariaDB 10.3.28 is not yet available in Debian stable, but I was able to obtain MariaDB 10.5.9 is provided by Debian testing branch. I installed that, plus its dependencies, on my test system, and the backups now work via my external shell script, or via the integrated web UI backup tool in iTop 2.7.3.
As far as I am concerned, though I do not speak for @Kristian, this problem is resolved.
For reference, our external backup script uses the following options on the mysqldump command:
The extra options are needed because some of our other applications use triggers and stored procedures.
Our backup script runs this command to back up the schema only (which is useful in case we need it for reference or documentation purposes), then it runs the same command again without the "--no-data" option. Obviously the two iterations are sent to different output files. We gzip the data dump but leave the schema-only dump unzipped for convenience, since these are very small.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey @Syscrusher thanks for clarifying that. I have tested only with mysqldump, because I'm using SQL database which is running on a different host, other than where the iTOP instance is running.
Because of that, I cannot use integrated backup tool. I simply don't have mysqldump locally installed.
The only way to do a backup of my existing database is by using phpmyadmin and do export of the database.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Kristian, ok so you're using a distant DB server.
Can you give same info as Syscrusher did ? iTop version, DB name & version, OS name & version, PHP version ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sure, I will have a look and let you know. By now, there is no available update in the Debian official repositories. So I have to add MariaDB specific repo.
I will write here when I have the time to test it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I decided to test with two scenarios, the first one is creating backup of the original database via phpMyAdmin and export functionality, then transfer this backup to the latest version of MySQL server (I've prepared local installation on the iTOP machine) and import the backup to it.
Although the export went fine, the import didn't generated any errors, and on first glance it looks like everything was fine, when I checked the content I was unable to see all the CI's, later on I've got some SQL errors - so I can conclude this scenarios has failed.
The second one was to do in place upgrade of the database. To be sure in case of failure I've created a backup via mariabackup tool locally, then upgraded the database to the latest version, and everything seems to be fine.
The mysqldump command is able to create backups for that database, and doesn't return any errors. I can check the sql file and it looks line as well.
So as conclusion we can say - yeah the MySQL was the culprit.
Last edit: Kristian 2021-04-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Good day! I apologize, I did not have time to work on this yesterday due to other projects. I am preparing to install the upgraded MariaDB on my test server now, and hopefully I will have test results here later today.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello guys,
I'm writing this post as follow up on the previous one: https://sourceforge.net/p/itop/tickets/1955/
So what I'm trying to do is to simply create backup of my iTOP database via mysqldump.
Why I'm not using the integrated backup solution - because I decided to use external database (the database is not on the same VM as iTOP application)
Can you advice me how I can solve this issue?
Thanks.
With all due respect to the iTop developers, I disagree with the assertion in the ticketing system that this is "not a bug". It is, very much, a bug.
I have just replicated precisely your error, on a brand-new, clean installation of iTop 2.7.3, using the integrated backup feature. I've tried all manner of options on a manual invocation of mysqldump to try to find a combination that will work. The error is due to something in the schema, perhaps a column name, because the error occurs even with "--no-data" specified to back up just the schema, and it occurs with --quote-names.
This was during an attempt to create an initial, baseline backup minutes after finishing the iTop installation wizard, before any data had been populated into the instance.
Installation details:
iTop 2.7.3
MariaDB Server 10.3.27
Debian Linux 10.8
PHP 7.3
The eventual goal, once backups are viable, is to migrate the database to our production MariaDB cluster, but for now it is running on the same machine as Apache and iTop.
This is a newly-provisioned, dedicated virtual server that will run nothing but iTop, so the environment is extremely clean other than the prerequisites for iTop and IPAM-for-iTop.
Here is the error:
Last edit: Syscrusher 2021-03-26
Hello,
No one ever said that ! I asked to create a discussion so that we can qualify this, in other words understand hwo to reproduce, if a workaround exists, etc.
It's in everyone's best interest to fix bugs in iTop. Having feedbacks from the community is very valuable to us !
And the application history demonstrate that lots of very good things happens thanks to the community : stability, improvements, feedbacks, security, ... (...)
But it is far more easier for us that problems encounters by an iTop user be discussed in the forum first, so that most feedback are obtained, and all the needed information are gathered. Everyone can participate in the forum, almost nobody does in the ticket system.
When we have a clear mind of the problem and know what to change thanks to the discussions in the forum, then we can create a ticket.
Oh ok when opening the ticket, I understand why you understood this :
Status: not-a-bug
Indeed, my mistake ! I've just changed to not-reproduced
At least I hope our way to deal with forums and tickets is clearer now O:)
That was also my source of misunderstanding, so thank you for clarifying your intent and the reason for referring the issue to the forum. I apologize if my tone was unduly harsh.
Thanks, you're welcome !
About the problem now :)
Oh, both iTop 2.7 and MariaDB... Isn't this bug you are dealing with : Backup & MariaDB
They seem very similar to me ?
If this is the same thing, seems like 10.3.28 is out now, can you give it a try ?
I am not able to see the linked wiki page because I do not have an account on the private wiki.
I will assume you are correct, as seems likely, and I will download the new version and install it. Our iTop installation is brand new and not yet production, so I can apply upgrades without disruption to our operations.
I will return here and report the outcome.
Ouch, I linked to the wrong site my apologies. Here is the correct link to the public wiki : Backup & MariaDB
I have good news. The MariaDB upgrade fixes the problem here.
MariaDB 10.3.28 is not yet available in Debian stable, but I was able to obtain MariaDB 10.5.9 is provided by Debian testing branch. I installed that, plus its dependencies, on my test system, and the backups now work via my external shell script, or via the integrated web UI backup tool in iTop 2.7.3.
As far as I am concerned, though I do not speak for @Kristian, this problem is resolved.
For reference, our external backup script uses the following options on the mysqldump command:
mysqldump --add-drop-database --complete-insert \ --create-options --quote-names --events \ --no-data --databases itop
The extra options are needed because some of our other applications use triggers and stored procedures.
Our backup script runs this command to back up the schema only (which is useful in case we need it for reference or documentation purposes), then it runs the same command again without the "--no-data" option. Obviously the two iterations are sent to different output files. We gzip the data dump but leave the schema-only dump unzipped for convenience, since these are very small.
Hey @Syscrusher thanks for clarifying that. I have tested only with mysqldump, because I'm using SQL database which is running on a different host, other than where the iTOP instance is running.
Because of that, I cannot use integrated backup tool. I simply don't have mysqldump locally installed.
The only way to do a backup of my existing database is by using phpmyadmin and do export of the database.
Hi Kristian, ok so you're using a distant DB server.
Can you give same info as Syscrusher did ? iTop version, DB name & version, OS name & version, PHP version ?
Sure, here is the required info:
iTOP side:
And DB side:
Ok, MariaDB 10.3.27 is the same version as Syscrusher. Can you check the same fix, meaning updating to 10.3.28 ?
Sure, I will have a look and let you know. By now, there is no available update in the Debian official repositories. So I have to add MariaDB specific repo.
I will write here when I have the time to test it.
Thanks !
Brief explanation what I've did:
I decided to test with two scenarios, the first one is creating backup of the original database via phpMyAdmin and export functionality, then transfer this backup to the latest version of MySQL server (I've prepared local installation on the iTOP machine) and import the backup to it.
Although the export went fine, the import didn't generated any errors, and on first glance it looks like everything was fine, when I checked the content I was unable to see all the CI's, later on I've got some SQL errors - so I can conclude this scenarios has failed.
The second one was to do in place upgrade of the database. To be sure in case of failure I've created a backup via mariabackup tool locally, then upgraded the database to the latest version, and everything seems to be fine.
The mysqldump command is able to create backups for that database, and doesn't return any errors. I can check the sql file and it looks line as well.
So as conclusion we can say - yeah the MySQL was the culprit.
Last edit: Kristian 2021-04-01
Warning, you're talking about MySQL whereas you sent screenshots showing MariaDB 10.3.27 !
Many thanks for the feedback anyway !
I'm waiting for Syscrusher's feedback before changing the ticket status.
Yeah, my fault I meant MariaDB. I continue to live with the feeling that they are same project :-) Sorry about that.
You're welcome :)
Believe me, at Combodo we know they are not the same ;o)
Good day! I apologize, I did not have time to work on this yesterday due to other projects. I am preparing to install the upgraded MariaDB on my test server now, and hopefully I will have test results here later today.
Hello, adding reference so that this discussion will appear directly in the ticket [#1955]
Related
Tickets:
#1955@pgoiffon I wish to extend my thanks to you for your assistance in resolving this problem.