MODX Quick Tip: MySQL Tables and Their Uses in MODX

Aug 9, 2012

 Where's My Site Data?

 You want to extract data from your MODX site, but only parts of it, say Resource Content, or Template Variable Values. This has a variety of uses, to update sites, migrate them, repair broken tables, etc. But what tables go with what parts of the CMS?

Here's a quick guide to what's what in the MODX MySQL database tables. This is by no means a complete nor advanced reference, but a quick guide to the most often used areas of the CMS. How to move the data around and manipulate those tables using a MySQL editor is the subject of another post ;)

MySQL Table Name

Used For

Screenshot of Related Manager Edit Page

modx_site_content

MODX Resources - values for all the fields in the standard MODX Resource Edit View, including the Document and Settings tabs. Resource Groups and Template Variables are in other tables (see below)

MODX Resource Edit

modx_site_htmlsnippets

MODX Chunks - values for all the fields in the standard MODX Chunk Edit View, including the Create/Edit and Properties tabs.

MODX Chunk Edit

modx_site_snippets

MODX Snippets - values for all the fields in the standard MODX Snippet Edit View, including the Create/Edit and Properties tabs.

MODX Snippet Edit

modx_site_templates

MODX Templates - values for all the fields in the standard MODX Template Edit View, including the Create/Edit and Properties tabs. Template Variables are in other tables (see below).

MODX Template Edit

modx_site_tmplvars

MODX Template Variables - TVs are dealt with in multiple tables. This table stores values for the General Information, Properties, Input Options and Output Options tabs. NOTE: the Content of each TV instance in Resources are stored elsewhere (see below)

MODX Template Variable Edit

modx_site_tmplvar_contentvalues

Stores the value of each instance of each TV, set in the MODX Resource Edit View - Template Variables tab.

MODX TV Content Values

modx_site_tmplvar_templates

Associates TVs with Templates - the Template Access tab.

MODX TV Template Access

modx_site_tmplvar_access

TV Access tab. The last tab “Media Sources” is in another table.

MODX TV Access Permissions