In this article, we will see how to reset resource ID in MODx Revolution.A resource represents a page in MODx and Each Resource has a unique resource ID.By Default, Modx uses resource ID for a link of MODx pages.
Sometimes you want to reset all resources and Its not possible from admin panel of MODx so I have reset the resources from the database.
Let’s see step by step to reset resourceID in MODx Revolution
NOTE: Make sure to take the backup of your database before executing any of the below steps because that will be useful if you fail at any step.
Step 1:
Open Database and go to the table {table_preix}_site_content table and take backup of table
Step 2:
Next,Truncate table {table_preix}_site_content by applying following query
1 2 3 | Truncate table {table_preix}_site_content |
Step 3:
Now, Insert one record into the table.It’s an insert query of home resource which will be required in table otherwise your site stops working.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | INSERT INTO {table_preix}_site_content (id, type, contentType, pagetitle, longtitle, description, alias, menuindex, searchable, cacheable, createdby, createdon, editedby, editedon, deleted, deletedon, deletedby, publishedon, publishedby, menutitle, donthit, privateweb, privatemgr, content_dispo, hidemenu, class_key, context_key, content_type, uri, uri_override, hide_children_in_tree, show_in_tree, properties) VALUES 1, '', 'test', 1, 1, 0, 1, 1, 1,, 1,, 0, 0, 0, 0, 0, '', 0, 0, 0, 0, 0, 'modDocument', 'web', 1, '', 0, 0, 1, NULL); |
NOTE: Resource IDs are strictly joined with many snippets and packages So if you reset the ID the website can stop working. so pl take a backup before executing any of the above steps
Here are the few other articles which you might like:
Import Users in MODx
Move Modx Revolution to Live Server
Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.