How to recover a customized deleted module's database?

I made a mistake, I deleted one of my customized modules accidentally.
Fortunately, I had my all data and the module back up before.
After I installed the module again, I found that all the information of the module was lost. And I could not import data because " Imports aren’t set up for this module type ". I could not create a new instance because “Database failure. Please refer to suitecrm.log for details.”
By checking the log, I found the database was deleted too, so it was clear now.
MySQL error 1146: Table ‘XXX’ doesn’t exist.
Meanwhile, some other databases can not be detected either because this database is linked to others like one to one, one to many.
Missing relationship definition XXX. skipping XXX subpanel.
So what should I do now, can I use the quick repair function? I am going to make a new system now…
Thanks!

Hi Keysu,

you write

I think you mean the table was deleted.

If you have a backup of your database, I would suggest that you import this backup to another database, then do a mysqldump and only dump the tables of your module. These should be named like “key_module” and in case you added fields through studio “key_module_cstm”. The exact name of the database table you can find out by checking the directory custom. The name of the table is the name of the directory in lowercase.

After inspecting the dump and making sure the dump only contains your module tables, you then import the dump into your current database.

You can also do a repair / Quick Repair and Rebuild, but it will only re-create the table, not re-create the data that was in it.