Upgrading MODx: Evolution to Revolution

Database Backup

There are a few things that have changed with the DB schema between these two iterations. Watch out for tables in Evo that have fields that are not present in the Revo DB schema. When doing a MySQL export/dump using SequelPro or similar, make sure the export doesn't include drop tables statements, and only export the tables you can't live without. The list below shows tables where all (or most) Evo fields are concurrent with Revo.

Some tables like modx_system_settings probably shouldn't be imported except by hand, only grabbing the necessary settings. Below I've listed the tables I found necessary and columns in Evo that aren't in Revo, but of course it will vary from site to site.

I've omitted a bunch of the tables that were more complicated to transition. An example would be the users tables: Evo to Revo there have been some relatively major schema changes related to users. One more thing, make sure to use a text format rather than binary when exporting the database as this will allow us to manipulate it using a stream editor of our choice.

Tag Syntax Conversion

Now that we've exported our DB, we can use a stream editor on the exported file to convert all our placeholders, dynamic links, snippet and chunk calls, etc. I have written some sed expressions that seem to do the trick. If anyone feels they could refine them, please do and let me in on it! Run the below in terminal (on Linux or OSX, if you're on Windows you're out of luck. ;-) ) replacing the insqlfile.sql and outsqlfile.sql:

sed -e 's/\[\([\*\+~\!]\)/[[\1/g' \
-e 's/\[(/[[++/g' \
-e 's/{{/[[$/g' -e 's/}}/]]/g' \
-e 's/[\+\!\*~)]\]/]]/g' insqlfile.sql > outsqlfile.sql

You may also edit your sql file in-place using sed, but I find it is better to keep both versions, just in case. You can test the above expressions on a simple sql file:



This does NOT convert PHx stuff, you'll have to do that manually (see Output Filters)

You may also do some snippet and plugin conversion at any time. Check the package management area in Revo to see which packages will be available (such as Wayfinder). This step is necessary as any custom snippets and those unavailable in Revo need to be converted to the new API (api.modx.com) or discarded--possibly in favor of an alternative. One last thing to note, Ditto is not supported in Revo...an option is to install getResources and convert your Ditto calls (perhaps I will cover that in another post).

Database Import

Assuming you have a clean installation MODx Revolution on your destination server, we can import our DB. First step in importing while following this guide is to add the fields to the Revo tables that were present in Evo. This allows us to perform our insert queries quickly. In the Evo table list above, I included the field names to add for each one.

After adding those extra fields to the Revo tables, perform your import. Once that is completed, delete the extra fields as Revo will not use them.

Minor Adjustments

At this point you may need to adjust some system settings, such as site_name, etc. If you haven't converted your necessary custom snippets and installed alternative packages for non-concurrent snippets, now would be the time to do that. I'd recommend going through your site page by page and troubleshooting any errors before calling it done, but otherwise, you're done!

Recent Posts

Improving MODX Page Speed for Google

Your website speed is impacting your bottom line , here are a few ways to improve it through browser caching, asynchronous loading of resources and other tips and tricks.

The Status of Liquid Web Cloud Sites Formerly of Rackspace in 2018

We've been a cloudsites customer since our inception, it's had ups and downs, here is what we think about it now.

OG Image Branding with phpThumb and MODX

Some of our clients have wanted to make sure their logo and branding appear in facebook, twitter, or messaging apps when shared. We came up with a clever solution.