ERROR!!! The code you are using is OLDER than the version that made these databases!

ERROR!!! The code you are using is OLDER than the version that made these databases!

Steven Cohen發表於
Number of replies: 12

I am on GoDaddy shared hosting and installed a moodle website about a 18 months ago: RetinaUniversity.com .  Last week, I tried to upgrade from Moodle 3.2 to 3.7 and failed.  I restored the backup of all of my files and a backup of my database from 2 days prior to the failed upgrade.  The website is working but when I try to login as administrator I get the following error:

ERROR!!! The code you are using is OLDER than the version that made these databases!

I installed Moodle using an 'Installatron' initially.  This no longer works because the installatron fails since the SQL database structure in godaddy shared hosting is antelope.  I cannot change this to barracuda.  I can switch hosting, but it would be a lot more expensive.  I am just trying to get the website back to where it was.

I read that I could try manually changing an entry in the SQL database (a very old post).  I tried going into the table mood_config.   The backup release was the proper version which is 3.2. I changed this to 3.2.3 and it didn't fix it and I changed it to 3.1 and that didn't fix it either.  

The version I am running is 3.2.3 

Any help would be appreciated

Thank you.

Steve

附件 error.png
評比平均分數: -
In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Rick Jerz發表於
Particularly helpful Moodlers的相片 Testers的相片

Your post contains a lot of issues, and sorting them out might take a while.

There are three components to moodle: 1) the application, 2) moodledata folder and contents, 3) the database.  To go back to where you were two days ago, all of these would have to be restored.  When you say that you restored the files, I am not sure if you meant all of these three components.  The error message is suggestions that your database is older than your Moodle, so maybe you didn't restore the exact version of Moodle that you were using two days ago???

You also mention "installatron."  The problem with "installatron" is that one never knows what these installers are really doing. Yes, these installer might seem to work well (this is how I began many years ago,) but they leave you in never-never land when confronted with the situation that you are now facing.

Some of your potential success will depend upon your backup files.  Had you ever tried an experimental restore?  How did you make the backups?  In other words, how do you know if your backups are good?

Many hosted servers, but not all, do not meet Moodle 3.7 minimum requirements.  I happen to run my small moodle on a GoDaddy Linux VPS.  Yes, more expensive, but it works.  I also own a small GoDaddy hosted server, and just the other day I was curious if I could install Moodle on it.  Nope!

If you have a small skillset of computer knowledge, such as FTP and SSH, you can try doing a manual reinstall of Moodle.  I would begin by installing a version of Moodle at about the same place as what you had two days ago, Moodle 3.2.???  In this manual install, create a database and the moodledata folder.  After success, then I would delete the database tables and import from your backup, and I would restore the old moodledata data into the appropriate folder.  This is all rather easy if you know what you are doing, and totally frustrating if you don't.  I am not sure about your knowledge about these things.

Give some of this some thought.  Get back with us.  

In reply to Rick Jerz

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Steven Cohen發表於

Rick,

First, thank you for offering to help.  I've been loading content onto this site for a few years and would hate to lose all that work.

I installed the website using the automatic installer on GoDaddy.  I am not sure where the moodle data directory is.  When I called support, at GoDaddy, and reviewed the directory structure with them, they could not help me to figure out which directory was the moodle data directory.  I have attached a picture which shows the directory structure for the website.  Since it is shared hosting, the support person thought that all the necessary files to run the site would be in the main directory (even though that is not recommended by moodle).  I am therefore not sure which of these directories is the moodle data directory.

When I restored the backup from two days before I crashed the website, I put up all the directories you see in the attached image.  I also restored the database from a backup of the sql.  In each case, for the restore, I deleted all the files that were in the main directory on the hosting site prior to loading the backup.  I also deleted all the tables from the SQL database prior to restoring the database.  

Since I removed everything from the site prior to the restore, I am not sure why the website thinks it is running code older than the databases.

Finally, when I asked the support person at GoDaddy about doing a manual install, they were not sure that was possible because of the permissions necessary to make changes in a shared hosting account.  That made me wonder if the automatic installer did something outside of the main directory that I could not reverse with my restored backup.  The person at support did not know and did not think anyone else there would know whether something was going on outside of the main directory containing all the website files.

If there is something I can can change in the databases to convince the website that it is no running code older than the databases that would be great.  I am pretty good with websites and PHP programming.  I have clearly much to learn about working with Moodle.

Thank you again,

All the best,

Steve

附件 moodle-3.2-RU-directories.
In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Emma Richardson發表於
Documentation writers的相片 Particularly helpful Moodlers的相片 Plugin developers的相片
I am not seeing anything there that looks like a moodledata directory and that is going to be the issue. It should not be in this folder - it should be up a level. The upgrade did something to your moodledata directory. You should be able to have GoDaddy restore your whole directory back to before the upgrade and that should get you back up.
In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Visvanath Ratnaweera發表於
Particularly helpful Moodlers的相片 Translators的相片
Looks like your site is running again. I believe that was a major scare. Always take a backup and download to your computer. Make sure that the backup is good by restoring it somewhere. Since your site still has only course content, no user interaction, individual https://docs.moodle.org/en/Course_backup could bring another level of security.
In reply to Visvanath Ratnaweera

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Ken Task發表於
Particularly helpful Moodlers的相片

Big +20 to this advice about backing up site **and** courses! 微笑

Site restored is a 3.2.x.

Before you attempt ANY upgrade by any method, advise check server Environment, update the component, then select desired higher version in the drop down list.   Pay attention to 'yellows' as well as 'reds'.

I personally think Moodle should provide an internal link when Admin visits the notifications page that reminds the Admin user to check environment.  Having that might head off mis-steps in what Installertron offers.

2 cents.

'SoS', Ken

In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Ken Task發表於
Particularly helpful Moodlers的相片

I see a 'data' directory ... which is not part of a stock 3.7.x

Could that be your moodledata?

For moodle to function, in config.php there has to be a full path
setting for 'dataroot' ...

$CFG->dataroot  = '/full/path/to/data';

Note no 'trailing slash' in that path.

If 'data' is your moodledata one will see structure similar to:

cache        filedir  localcache  models  repository  temp
environment  lang          lock        muc     sessions    trashdir

Might have a hidden .htaccess file contained therein.
Of those above, filedir the most important as that's the directory
where moodle stores all files uploaded to the moodle.
Nothing in there is humanly re-cognizable ... only the warning.txt file.

Also see directories like course_videos, course-images, exam-imagees,_notes,cgi-bin which appear to be where you might have been using them as file respos and simply linking via URL to contents.  So those would need to stay.

As far as moodle being confused about version ... possible ... a failed upgrade could have touched tables in DB just enough ... wish changing column info in one table would fix it, but that's not how moodle works.

So far, Emma's suggestion about asking GoDaddy to restore a backup of your entire account perhaps the best way to get back up and running - with understanding that if that customer site backup was made a month ago, your restored site would loose a months worth of data.

My 2 cents ...

Could get onto a rant about how semi-criminal the situation is ... but am not a 'customer' ... shall refrain!

But let these speak for themselves:

https://www.godaddy.com/community/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&q=moodle

Looks like GoDaddy has issues with Instalatron going back some time:

https://www.godaddy.com/community/GoCentral-Website-Builder/Moodle-MySQL-Barracuda-format-is-not-available/m-p/120363#M6641

'SoS', Ken

In reply to Ken Task

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Steven Cohen發表於
Ken (and everyone),

Thank you for your advice.

I checked the config.php and the directory called 'data' is the moodle data directory. That is what the dataroot points to in $CFG.  I did restore that directory when I restored my other backed up files and directories and the database.  I'm not sure why I am getting the error.  Something must have happened to the database when I tried and failed to upgrade to moodle 3.7.  I don't know how it could persist when I deleted all the tables in the database and replaced them with the backup.  

I have included a picture of the sub-directories in the data directory to this post. Now that I know that is the data directory, I could try to do an upgrade myself. I am pretty sure my hosting environment will handle up to moodle 3.4. The database structure becomes more of a problem after that.  I could remove all the files except the data directory and then replace the files with a newer version of moodle (if I can find 3.4) and follow the upgrade instructions in the documentation.

What do you think about me saving the 'data' directory, replacing everything else and trying an upgrade?  I would like things to go back to where they were by changing a value in one of the databases but it seems like that is not possible?   

I have never tested my backups to see if restoring from a backup would work.  I have restored other websites successfully from backups (I have retinagallery.com which is a coppermine site and sometimes have to restore that from a backup).  I have not tried to restore the moodle site.  This is my only moodle website.

Thanks again for the help.
All the best,
Steve

Again, thank you all very very much,
All the best,
Steve
附件 data-file-moodle.png
In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Rick Jerz發表於
Particularly helpful Moodlers的相片 Testers的相片
When you find the time, you could always learn to install Moodle manually, even on your hosted server (an older version of Moodle, but maybe matching your 3.2.) Then, after this moodle (let's call it moodle2) is running, try restoring your backups to it. You will learn a lot along the way.
In reply to Rick Jerz

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Steven Cohen發表於
Thank you all for the help.

I installed moodle 3.3 as an upgrade (I was using 3.2). I did this manually and added back in my data directory and the config.php file.

IT WORKED!!

I lost my theme which is not a big deal. I am now able to access the admin section of the website.
Thank you all for the help. I have no idea why the backup wouldn't work but it didn't.

I will back up my course separately (I only have one course on the website) and hopefully my question bank.

Thanks again.
All the best,
Steve
評比平均分數:Useful (1)
In reply to Rick Jerz

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Steven Cohen發表於
I there a way to mark this thread as resolved? This is my first time in the discussion forum?
Thanks,
Steve
評比平均分數:Useful (1)
In reply to Steven Cohen

Re: ERROR!!! The code you are using is OLDER than the version that made these databases!

Rick Jerz發表於
Particularly helpful Moodlers的相片 Testers的相片

Most times, when it appears that a problem is solved, the discussion comes to a natural end.  This post of yours, along with your other post is fine.  This discussion will remain in Moodle for quite a while, and possibly help others.

We look forward to having you back!  微笑