MODX Community

Errors when creating templates or resources after site migration

Hello everyone,

I have a problem that I can’t seem to fix and I’m hoping someone might have have encounter this before and has a solution.
I have a modx site that has been moved to a different server. I didn’t do the migration and have no information about any errors during the process.
Now I have to add some functionality and I have problems creating any kind of elements. For example, I tried creating a template and after save I get an error “Template not specified”. I noticed it appears in the elements tab, but it’s id is 0. The same thing happens when creating resources or even users. I checked the database and in the users table, for example, I have several users added, all with same id of 0.
Clearing cache also produces an error. I’m attaching a screenshot.

Did anyone encounter something similar or has some suggestions on what might cause this issue?

Normally the database tables have an “id” column with AUTO_INCREMENT that automatically assigns a unique id for a new row.


This doesn’t seem to work anymore.
Can you check the database. Are the indices missing in the database tables?

Hi @halftrainedharry

Thank you for your reply. I checked the database. It seems many tables lost some or all indexes.
Any idea on how to fix it?

You could add them by hand in phpMyAdmin or with SQL statements, but that is very tedious and error-prone.
Do you still have an SQL Dump from the migration? Maybe you can try to restore the data from the file again and check if it works this time.

Thank you, I will try it.