Page 1 of 2

[SOLVED] How to restore from an old CMS Made Simple DB

Posted: Wed Jun 05, 2013 8:44 pm
by thumbsucker
I have a CMS Made Simple DB that is approximately 1.5 years old.

Is there any way for me to identify which version of CMS Made Simple that it was created with, and to restore it to that version?

Unfortunately, I wiped my site clean by accident and this was the only backup I could recover.

This is an emergency request and any help would be greatly appreciated.

Thank you.

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Wed Jun 05, 2013 9:28 pm
by velden
Database has a table with DB schema version (at least, that's what I assume)

Example from export:

Code: Select all

--
-- Table structure for table `cms_version`
--

CREATE TABLE `cms_version` (
  `version` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cms_version`
--

INSERT INTO `cms_version` VALUES('36');
With that version, you might be able to determine which version(s) were installed.

To recover, you probably want to check the versions too for extra installed modules: 'cms_modules' table.

I don't know an efficient way to find CMSMS version by DB schema version. I see that in /install/schemas/extra.sql a line exists:

Code: Select all

INSERT INTO {DB_PREFIX}version VALUES (36);
In this case that's the extra.sql file of CMSMS 1.11.6 so again I assume that with a cms_version of 36 you can use CMSMS 1.11.6

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Wed Jun 05, 2013 10:32 pm
by calguy1000
If all you have is the database... and you've nuked all of your files, and don't have a backup... you are in a tough spot. Depending on the site and it's content you should probably consider rebuilding the whole thing.

CMSMS does not keep a 'software version' number in the database anywhere. The only place the 'software version' is available is in the version.php file.

The database holds the 'schema version' which is different. The schema version may not change for a release of CMSMS. or it may change for a point (bugfix) release.

You will have to find the largest CMS version available with that schema value, and 'try it'. If that doesn't work properly (and "properly" is subjective to other factors such as customizations) you may have to go further down in version. Also, there is no 'map' available as to which schema version was used in which CMSMS version. So you just have to blind guess as to which version to download, expand, check the version.php file of that version, etc.

Once you have the CMS version that you will 'try'. You will also need to get the modules that were installed. This is available from the 'cms_modules' database table. You can then download these module versions from the forge, and install them.

However. If you deleted all of the files, you are still only partly done. Things that can't be restored are:
a: the .htaccess file (particularly if you had any custom rules or 301 redirects for SEO purposes)
b: Images, Videos, text files, PDF files, etc. that were linked to in the content of your pages or modules.
c: Images that were linked to in your stylesheet(s).
d: any customizations in the module_custom directory
e: custom plugins

I think you are going to be facing a very large uphill battle.

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Thu Jun 06, 2013 12:00 am
by calguy1000
follow up: If you are using a hosting provider (and not self hosting your website). It would be a good idea to try to contact your hosting provider and see if they have a backup they can restore.

Some hosting providers don't provide backup services, but many do. Though it may cost a few bucks.

Even a backup from a month or so ago would be better than nothing.

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Thu Jun 06, 2013 12:48 am
by paulbaker
thumbsucker wrote:I have a CMS Made Simple DB that is approximately 1.5 years old.
calguy1000 wrote:So you just have to blind guess as to which version to download, expand, check the version.php file of that version, etc.
To help, you can use this page which shows CMSMS version releases over the years:
http://dev.cmsmadesimple.org/project/files/6

1.5 years takes you back to December 2011 which, assuming you kept the site up to date, would be CMSMS version 1.10.2.

I agree with Calguy, check with your host - even if they don't make a big thing of marketing a backup service, I bet they have one.

Good luck :)

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Thu Jun 06, 2013 4:32 am
by thumbsucker
I have very happy news (I think).

I was able to locate the exact duplicate of the site from 11/10/2011. Version.php states it is version 1.9.4.3

I believe it should match the version of the DB backup I have, although I am not certain.

On the other hand, I am currently running the following on my server:

MySQL Version 5.5.30-cll
PHP 5.3.24

UPDATE:

I uploaded the old CMS Made Simple files to a live domain, created a new DB, imported the old DB into the new DB, and managed to get it online.

However, trying to upgrade to 1.10.3 from 1.9.4.3 seems to break the web site and "Fatal error: Cannot override final method CMSModule::listTemplates() in /home/site/public_html/modules/Glossary/Glossary.module.php on line 1429" on Step 6.

Any idea what could be wrong?

Thank you.

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Thu Jun 06, 2013 4:03 pm
by Dr.CSS
You may need to make sure you upgrade 3rd party modules like glossary, using module manager, before upgrading CMSMS...

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 6:41 am
by thumbsucker
It worked!!!

Many thanks!!

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 7:01 am
by staartmees
Please add [SOLVED] to the subject of this thread

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 9:31 am
by thumbsucker
I spoke too soon.

In the Admin menu, whenever I try to access a content page or the templates, I get the following error:

Fatal error: Call to a member function TemplateId() on a non-object in /home/site/public_html/plugins/function.stylesheet.php on line 56

Anyone know a fix for this?

Re: Emergency: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 9:36 am
by velden
{stylesheet} tag is deprecated {cms_stylesheet} is it successor.

http://docs.cmsmadesimple.org/tags/core/stylesheet-tag

Also depends on the version you're now running.

Re: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 1:24 pm
by thumbsucker
Thank you for all your help.

Site is now online!

But I'm getting this weird  character on hundreds of pages throughout the site.

Is there some global find and replace that could take care of this by any chance?

The WYSIWYG editors also do not seem to be working. I'm just seeing raw HTML. I flipped on the settings and tried both TinyMCE and MicroTiny and neither appear to be coming online. Any idea what might be the issue?

Re: EMERGENCY: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 3:29 pm
by Dr.CSS
The strange A has to do with DB collation or some such, you may have to run a SQL query or edit each page as some times those were other characters...

There are a few things in forum for how to get tiny back, one is to uninstall/install it, also make sure it is up to date in module manager...

Re: EMERGENCY: How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 5:15 pm
by thumbsucker
Yeah, I tried uninstalling and installing again, but that didn't work unfortunately.

Not looking forward to looking through hundreds of pages for hundreds of 'A' characters...

Re: [SOLVED] How to restore from an old CMS Made Simple DB

Posted: Fri Jun 07, 2013 7:15 pm
by thumbsucker
Everything was SOLVED!

Thanks everyone.