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!

by Michael Knichel -
Number of replies: 3

Tonight, I ran my upgrade script on my dev server and it worked fine.  I then ran the upgrade on my production server and it did NOT work fine.

#sh upgrade_moodle.sh > upgrade_moodle.sh.log
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
mysqldump: [Warning] Using a password on the command line interface can be insecure.
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
No upgrade needed for the installed version 3.9.7 (Build: 20210510) (2020061507). Thanks for coming anyway!
So I compared the version in the db with the one in version.php
mysql> select name,value from mdl_config where name like 'version';
+---------+------------+
| name    | value      |
+---------+------------+
| version | 2020061507 |
+---------+------------+
1 row in set (0.01 sec)

# fgrep '$version' version.php
$version  = 2020061507.00;              // 20200615      = branching date YYYYMMDD - do not modify!
I don't know what to do next?  It appears that they are the same.

MK
Average of ratings: -
In reply to Michael Knichel

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

by Michael Knichel -
I restored successfully from my backup, but I still want to upgrade my prod server. Please advise...
In reply to Michael Knichel

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

by Susana L. -
Since Git 2.27 "git pull" issues a warning message like the one you mentioned.
I also got that message and for what I could understand if you just want to upgrade a module or a moodle instance with no local commits/updates (I mean no customizations) It is recommended to use git "pull --ff-only" (or configure according the warning and just continue to use only "pull")

https://stackoverflow.com/questions/62653114/how-to-deal-with-this-git-warning-pulling-without-specifying-how-to-reconcile
https://blog.sffc.xyz/post/185195398930/why-you-should-use-git-pull-ff-only-git-is-a
Average of ratings: Useful (1)