Downgrading Your Concrete5 Site
Even in a great CMS like Concrete5 it's possible to encounter glitches, bad installs, or packages that don't update well. I decided to write this little tutorial after I personally had to downgrade this site (www.rynomediaonline.com) as well as two others from Concrete5.4.2.x to 5.4.1.1. At the same time I noticed an influx of questions on the forums about how to do this as well as recieving an email or two.
So, on the unlikely chance that your upgrade to the latest version of C5 didn't take here's how you can get your site up and running again.
First: Make Back-Ups
An important part of maintaining your website is making periodical back-ups. Concrete5 has an easy way to do this via the Dashboard. It would be wise to take full advantage of this feature.
In the image above I made a backup at 12:39 PM and then upgraded my test version of Concrete5. I then made a second backup and upgraded to most recent version (5.4.2.1).
Now, in a perfect world, you could navigate back to this page and run a restore to downgrade your site to a previous version.
This does work. Before writing this tutorial I ran upgrades and restores on several test sites to see what would happen. 3 out of 4 sites upgraded and then downgraded without a hitch - the way it is designed to. However, on the 4th site and consequently the testing environment that is most important to me, the downgrade went bad:
This error blocked me from being able to login in to my site. Big Problem! But never fear, a few clicks and I was back in and running again.
This is where this Tutorial gets meaty. The trick is that when you 'Restore' from a previous back-up you are obviously restoring the database of a previous version of your site. Not just a previous, as in old, but also a previous version of Concrete5. If the restore doesn't 'take' it's almost always because there is a conflict between your database and the version of Concrete5 that your site wants to run. To fix this...
Second, Edit Your Site.php File:
You will need access to your website's root folders either via Cpanel or FTP. Navigate to Root/Config/site.php and open it up. You'll find a series of lines that look like this:
You'll notice on line 9 that my site.php is trying to work with 5.4.2.1 but my database/restore was from version 5.4.1.1. You can also note that preceding the concrete5 version is this code: 'DIRNAME_APP_UPDATED' What this indicates is that my site is working from the concrete5.4.2.1 folder in the Updates folder of my root directory. By simply changing 'concrete5.4.2.1' to 'concrete5.4.1.1' I was able to restore my site, login, and ensure that everything is working great.
That's it! Simple and easy in two steps. First, run a restore. Second, check and edit your site.php file.
For Drastic Measures:
Just after finishing this tutorial I saw another downgrade situation on the forums which brought to my attention that this tutorial is imcomplete. There can be situations where immediately following an upgrade your site crashes or you are unable to login. (the example above is an error that occured after I ran the downgrade from the dashbaord - so updating the site.php file was a simple fix).
This type of error will require you to force a downgrade by uploading/importing a back-up of your database into your MYSQL and then configuring your site.php file. So...
First, You will need to login into your phpMyAdmin database account. This can be found by going to your websites backend or "CPanel". And locating the link to phpMyAdmin. This should open a new tab or window.
Second, Locate your Concrete5 database from the left-hand column and click on it. This will open that database.
Third, Click the "Import" tab at the top of the page. On the next page click the 'Browse' button to locate your saved backup database - then click "Go" in the bottom left corner.
Fourth, follow the instructions from above for updating your website's 'site.php' file. This should get you back up and running.
Thanks,
Ryan Vars
RynoMedia