Autonumbering stops working after export

I created a module, of type issue, and the issue numbering works fine.

However, I have exported this module, and imported into a new instance, and now the autonumbering no longer works when I publish into that new instance.

Does anyone have any idea what might be going wrong?

I am exporting and importing into 7.11.21(build 344)

Hi, can you check the database table for this module in both systems?

For example in cases the field case_number has the attribute “AUTO_INCREMENT”.

MariaDB [suite71122]> describe cases;
+-----------------------+--------------+------+-----+---------+----------------+
| Field                 | Type         | Null | Key | Default | Extra          |
+-----------------------+--------------+------+-----+---------+----------------+
| id                    | char(36)     | NO   | PRI | NULL    |                |
| name                  | varchar(255) | YES  | MUL | NULL    |                |
...
...
| case_number           | int(11)      | NO   | UNI | NULL    | auto_increment |

Maybe for some reason the attribute “AUTO_INCREMENT” was not set for your field when the table was created.

You can then add this attribute by SQL like (replace <table> by the table name of your module and <field> by the auto increment field name):

alter table <table> modify <field> int(11) not null auto_increment unique;

or check the vardefs of your module, see

As you have imported your module, instead of in custom/Extensions/modules..., you’d probably look in the following file:
modules/<modulename>/vardefs.php

and locate the line

    '<field>' => array(

and add below

        'auto_increment' => true,

and locate the line

    'indices' => array(

and add below

        'name' => '<field>', 'type' => 'unique', 'fields' => array('<field>'),

Afterwards, do a Admin->Repair->Quick Repair and Rebuild, scroll down and execute the proposed SQL by clicking “Execute”