glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.1k stars 1.27k forks source link

[GLPI 10.0.0-rc1] php bin/console glpi:migration:unsigned_keys #10534

Closed stdglpi closed 2 years ago

stdglpi commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.0-rc1

Bug description

Hello,

I have migrated GLPI v10 to v10.0.0-rc1

At the starting page we have a message to pass the following command :

2 primary or foreign keys columns are using signed integers

the command is : _php bin/console glpi:migration:unsignedkeys

Relevant log output

The logs (cmd) :

C:\inetpub\wwwroot\glpi>php bin/console glpi:migration:unsigned_keys
Found 2 primary/foreign key columns(s) using signed integers.
Voulez-vous continuer ? [Yes/no]yes
Migration of column "glpi_plugin_news_alerts_targets.items_id" cannot be done as it contains negative values.
Migration of column "glpi_tickets_contracts.contracts_id" cannot be done as it contains negative values.
 2/2 [============================] 100%
Des erreurs se sont produites pendant la migration.

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

Operating system: Windows NT SRV-GLPI 10.0 build 14393 (Windows Server 2016) i586 PHP 8.0.0 cgi-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, cgi-fcgi, ctype, curl, date, dom, exif, fileinfo, filter, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, readline, session, soap, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib) Setup: max_execution_time="600" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="20M" Software: Microsoft-IIS/10.0 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0 Server Software: MySQL Community Server - GPL Server Version: 8.0.27 Server SQL Mode: STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION Parameters: root@localhost/glpi Host info: localhost via TCP/IP

Anything else?

No response


Plugins list -- ​ Name: Alertes Version: 1.10.0-rc1 State: Enabled
Name: Form Creator Version: 2.13.0-alpha.2 State: Enabled
Name: Gestion des tags Version: 2.9.0-rc1 State: Enabled

cedric-anne commented 2 years ago

Hi,

Migration of column "glpi_plugin_news_alerts_targets.items_id" cannot be done as it contains negative values.

There is a new release of the news plugin that should replace usage of negative values in this field.

Migration of column "glpi_tickets_contracts.contracts_id" cannot be done as it contains negative values.

This one need to be checked. How many negative values have you in this field ?

stdglpi commented 2 years ago

Hello @cedric-anne

Thanks for the tips, I tried to upgrade the plugins => News and Tags => OK For the plugin => Formcreator i'm facing an issue

(I try to follow this topics => https://github.com/pluginsGLPI/formcreator/issues/2575 )

For the moment I have 1 errors instead of 3.

image image

I don't know if the last error is related to the plugin formcreator.

to be continued :)

stdglpi commented 2 years ago

@cedric-anne for information, I passed also Formcreator v2.13.0-alpha.3.

Still one error :

image

Have a good day,

cedric-anne commented 2 years ago

Negatives values on this field are not legitimate.

Was your GLPI instance created on v10 or in a previous version ?

stdglpi commented 2 years ago

@cedric-anne the GLPI instance was created on a ~ v9.5.0

stdglpi commented 2 years ago

@cedric-anne should I change the ID to "0" ?

image

stdglpi commented 2 years ago

@cedric-anne I just checked if I put "1" on contracts_ID and I start the command. Seems ok :)

image

cedric-anne commented 2 years ago

@cedric-anne should I change the ID to "0" ?

You should change ID to 0 if there is no contract linked to these tickets.

jrivera92 commented 2 years ago

I migrate from 9.5.7 to 10 and get an error: 1307 primary or foreign keys columns are using signed integers. Run the "php bin/console glpi:migration:unsigned_keys" command to migrate them.

When I run the bin I get the following error:

Parse error: syntax error, unexpected '?' in C:\wamp64\www\help.desk.pdp\bin\console on line 72

image

cedric-anne commented 2 years ago

I migrate from 9.5.7 to 10 and get an error: 1307 primary or foreign keys columns are using signed integers. Run the "php bin/console glpi:migration:unsigned_keys" command to migrate them.

When I run the bin I get the following error:

Parse error: syntax error, unexpected '?' in C:\wamp64\www\help.desk.pdp\bin\console on line 72

image

@jrivera92 It seems that your PHP version is lower than 7.0. You have to use, at least PHP 7.4 for GLPI 10.0.

cedric-anne commented 2 years ago

For illegitimate negative values in GLPI core, they will be handled by #10763 . For thoose related to plugins, fix has to be produced on plugin side.

stdglpi commented 2 years ago

Hello all,

@cedric-anne the problem seems to be fixed now :)

msource commented 2 years ago

Hello,

I'm having the same problem but on another table: image

What I can do about this? GLPI was upgraded from 9.5.X.X to new version 10.

Sincerely, Marcos Fernandes

cedric-anne commented 2 years ago

I'm having the same problem but on another table: image

What I can do about this? GLPI was upgraded from 9.5.X.X to new version 10.

Negative values on this field are not legitimate, you can apply #10763 and run the migration again.

Limaldo commented 1 year ago

Hello,

Taking advantage of this post, I'm getting the error below when running: php bin/console glpi:migration:timestamps

0%SQL Error "1292": Incorrect datetime value: '2050-03-01 12:00:00' for column glpidb.glpi_knowbaseitems.end_date at row 35 in query "ALTER TABLE glpi_knowbaseitems MODIFY COLUMN date_mod TIMESTAMP NULL DEFAULT NULL, MODIFY COLUMN begin_date TIMESTAMP NULL DEFAULT NULL, MODIFY COLUMN end_date TIMESTAMP NULL DEFAULT NULL; " Update of glpi_knowbaseitems failed with message "(1292) Incorrect datetime value: '2050-03-01 12:00:00' for column glpidb.glpi_knowbaseitems.end_date at row 35". 1/1 [==============================] 100% Errors occurred during migration.

Limaldo commented 1 year ago

Hello,

Taking advantage of this post, I'm getting the error below when running: php bin/console glpi:migration:timestamps

0%SQL Error "1292": Incorrect datetime value: '2050-03-01 12:00:00' for column glpidb.glpi_knowbaseitems.end_date at row 35 in query "ALTER TABLE glpi_knowbaseitems MODIFY COLUMN date_mod TIMESTAMP NULL DEFAULT NULL, MODIFY COLUMN begin_date TIMESTAMP NULL DEFAULT NULL, MODIFY COLUMN end_date TIMESTAMP NULL DEFAULT NULL; " Update of glpi_knowbaseitems failed with message "(1292) Incorrect datetime value: '2050-03-01 12:00:00' for column glpidb.glpi_knowbaseitems.end_date at row 35". 1/1 [==============================] 100% Errors occurred during migration.

Upgrading to version 9.5.9 and later to 10.0.3 did not show an error.