News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Alternative “Backup”

Started by Volker S, July 04, 2025, 09:20:44 AM

Previous topic - Next topic

Volker S

If something goes seriously wrong when resetting the software or individual add-on modules in the package manager, how can you restore an older backup without creating the corresponding old database (new posts will be lost)?
Example: You transfer the backup from 2.1.5 to your server in a new directory. When you access the forum, you get the following message (see image).
To avoid losing any posts, can I fix the error using repair-settings.php?

shawnb61

Two options:
 - Keep the files & db in sync
 - Update 'smfVersion' in the settings table

Note that there were a couple minor db changes in 2.1.5, so the first option is preferred.  Unless you want to revert the db changes by hand.

There were no db changes in 2.1.6.  So going from 2.1.6 back to 2.1.5 you can get away with just updating smfVersion.

Uninstalling the package keeps everything in sync, but is usually not advised.
A question worth asking is born in experience & driven by necessity. - Fripp

Volker S

In my case, this means the following:
I can access a backup of 2.1.5 with the current database (2.1.6)  if I change the database version to 2.1.5.
For all other backups, I have to restore the old database in addition to the old forum. There is no other solution, right?

Where can I find the settings table to set the database version from 2.1.6 (which is what it is now) to 2.1.5?

CRM 114

Quote from: Volker S on July 04, 2025, 10:54:27 AMWhere can I find the settings table to set the database version from 2.1.6 (which is what it is now) to 2.1.5?
I don't know, if you are familiar with this, but you can connect to your database e.g. with phpMyAdmin or a similar tool. Select the table "settings" (could have a prefix, depending on your configuration) and search for "smfVersion" in column "variable".
German Wet Shaving Forum: www.gut-rasiert.de/forum

Doug Heffernan

Quote from: Volker S on July 04, 2025, 10:54:27 AMI can access a backup of 2.1.5 with the current database (2.1.6)  if I change the database version to 2.1.5.

To clarify, you mean to install a backup made on a 2.1.5. version into a 2.1.6 forum? If that is a yes, you don't need to change the version. You can simply use the update link from the Package Manager to bring the database to 2.1.6. That last step might not even be necessary seeing the fact that there weren't any database changes between those 2 versions.

Quote from: Volker S on July 04, 2025, 10:54:27 AMFor all other backups, I have to restore the old database in addition to the old forum. There is no other solution, right?

For all older backups it's the same procedure. You can install them directly on a 2.1.6. forum. If the old backups are from the 2..0 series you will have to run the 2.1.6. upgrader to bring the old database up to date to match your forum files.

shawnb61

Quote from: Volker S on July 04, 2025, 10:54:27 AMI can access a backup of 2.1.5 with the current database (2.1.6)  if I change the database version to 2.1.5.
Correct.  There were no DB changes between 2.1.5 & 2.1.6.  Just change the smfVersion to match the code & you're good.

Quote from: Volker S on July 04, 2025, 10:54:27 AMFor all other backups, I have to restore the old database in addition to the old forum. There is no other solution, right?
As noted above, if you're comfortable doing the db changes by hand, you can do that.  Or just deinstall the patch.  The db changes can be read within the patch, within package-info.xml.

The changes are minor - a couple index tweaks.  But there are corresponding code changes for one of them, and the code & db must be in sync.

Quote from: Volker S on July 04, 2025, 10:54:27 AMWhere can I find the settings table to set the database version from 2.1.6 (which is what it is now) to 2.1.5?
In cPanel, in phpmyadmin.  The table is smf_settings (assuming your prefix is smf_). 

You've got to be comfortable making DB changes.  It's worth learning phpmyadmin if you are an app admin.
A question worth asking is born in experience & driven by necessity. - Fripp

shawnb61

Of course, the above assumes you're staying within 2.1.x.  Doug is correct, above, that you need to fully restore code & db if you're going back to 2.0.x or prior.
A question worth asking is born in experience & driven by necessity. - Fripp

Volker S

I will now try to describe the basic situation in this Link. Thank at all.

Advertisement: