Database backup restore invalid

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
</Solidjeuh>
Registered User
Posts: 1687
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Database backup restore invalid

Post by </Solidjeuh> » Mon May 06, 2019 12:29 pm

I still can't login into the bug tracker, so I post it here.
I made a database backup on my test board via ACP, when restoring the database I get this error:

Image

Tried with Gzip & bzip2

phpBB 3.2.7
PHP: 7.2.17
Database server: MySQL(i) 5.5.60-MariaDB

User avatar
KillBill.
Registered User
Posts: 596
Joined: Tue Jun 02, 2009 4:07 pm
Contact:

Re: Database backup restore invalid

Post by KillBill. » Mon May 06, 2019 12:34 pm

Confirmed, restore not work

[phpBB Debug] PHP Notice: in file [ROOT]/includes/acp/acp_database.php on line 219: Undefined index: extensions

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Mon May 06, 2019 1:52 pm

KillBill. wrote:
Mon May 06, 2019 12:34 pm
[phpBB Debug] PHP Notice: in file [ROOT]/includes/acp/acp_database.php on line 219: Undefined index: extensions
Looks like line 219 incorrectly tries to reference "extensions", instead of "extension" as intended. Making that change allowed the restore to proceed.

User avatar
</Solidjeuh>
Registered User
Posts: 1687
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Database backup restore invalid

Post by </Solidjeuh> » Mon May 06, 2019 1:55 pm

Yes that worked.
changed switch ($backup_info['extensions']) to switch ($backup_info['extension'])


Someone should make a ticket for it, I can't...

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Mon May 06, 2019 2:29 pm

</Solidjeuh> wrote:
Mon May 06, 2019 1:55 pm
Someone should make a ticket for it, I can't...
https://tracker.phpbb.com/browse/PHPBB3-16048

User avatar
Scorpy
Registered User
Posts: 16
Joined: Wed May 01, 2019 11:58 am
Contact:

Re: Database backup restore invalid

Post by Scorpy » Mon May 06, 2019 7:51 pm

This appears to have been introduced during the https://tracker.phpbb.com/browse/PHPBB3-15928 changes in phpBB 3.2.6 and later. User KillBill. had debug enabled, which catches that /includes/acp/acp_database.php line 219 attempts to reference array index "extensions", instead of the "extension" index that exists in backup_info.
Should we all change that line in acp_database.php after update to phpBB 3.2.7 or you programmers are preparing a patch in order to fix that problem?

Or should we all just wait for phpBB 3.2.8?

User avatar
</Solidjeuh>
Registered User
Posts: 1687
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Database backup restore invalid

Post by </Solidjeuh> » Mon May 06, 2019 8:33 pm

Scorpy wrote:
Mon May 06, 2019 7:51 pm
Or should we all just wait for phpBB 3.2.8?
If you don't use the "restore" function, you can just leave it for now. I never use that function. Just tested it today because KillBill said it was not working.

User avatar
Scorpy
Registered User
Posts: 16
Joined: Wed May 01, 2019 11:58 am
Contact:

Re: Database backup restore invalid

Post by Scorpy » Mon May 06, 2019 8:42 pm

</Solidjeuh> wrote:
Mon May 06, 2019 8:33 pm
If you don't use the "restore" function, you can just leave it for now.
I do not use it, but you never know when you might need it.

Thanks for help. :)

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Mon May 06, 2019 8:52 pm

Agreed this isn't something to recommend as an "everybody should go do this right now" scenario. Since it's database restore, and hopefully you need to use that zero times between now and the next release. 😁 But for anyone who does need to fix or utilize the in-application Restore option, it's definitely a fix that is quick to implement.

If you need the changes and aren't fully confident in editing line 219 the file, the attached /includes/acp/acp_database.php file for phpBB 3.2.7 contains the change. When updating your board, note that there is a file of this same name one level deeper, under /includes/acp/info/, which is not the one you intend to overwrite.

Also note that the database backup in question here is ultimately just a UTF8-encoded text file containing SQL commands, as are the database backups by many tools. Even outside of this phpBB 3.2.7-related scenario, if you were ever in a jam where phpBB's ACP and/or the ACP Restore function was unavailable to you, note that you could also expect success in using your hosting account's phpMyAdmin or other database tool to restore this backup.
Attachments
acp_database.php
(13.97 KiB) Downloaded 18 times

User avatar
Scorpy
Registered User
Posts: 16
Joined: Wed May 01, 2019 11:58 am
Contact:

Re: Database backup restore invalid

Post by Scorpy » Mon May 06, 2019 10:30 pm

EA117 wrote:
Mon May 06, 2019 8:52 pm
(...) If you need the changes and aren't fully confident in editing line 219 the file, the attached /includes/acp/acp_database.php file for phpBB 3.2.7 contains the change. When updating your board, note that there is a file of this same name one level deeper, under /includes/acp/info/, which is not the one you intend to overwrite.
Thank you, EA117 - you are my hero! :D

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Tue May 07, 2019 12:03 am

You're welcome. 3Di has also created the actual phpBB code change submission for us on this issue, in case that helps anyone else visually confirm the intended and correct change.

User avatar
Joyce&Luna
Registered User
Posts: 263
Joined: Wed Oct 14, 2015 3:46 pm
Location: Germany
Name: Anke
Contact:

Re: Database backup restore invalid

Post by Joyce&Luna » Tue May 07, 2019 11:05 pm

The backup from Store can be uploaded with phpMyAdmin.
But the phpBB version jumps back to phpBB 3.2.5. The error must already have been in phpBB 3.2.6.
Because before I switched to 3.2.7, I had 3.2.6.
Only if you update phpBB 3.2.7 again, everything is okay again.
My contributions are translated from German to English by google. This can lead to misunderstanding.

phpBB Style Design

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Tue May 07, 2019 11:35 pm

Joyce&Luna wrote:
Tue May 07, 2019 11:05 pm
But the phpBB version jumps back to phpBB 3.2.5.
Agreed. Regardless of what method you use to restore the backup, the data on your board when you're finished with a successful restore is going to be the data that was in the backup. Which isn't "specifically 3.2.5", and would be whatever version was installed at the time the backup was made hours / days / weeks / months / years ago.

Unless the restored backup was from the same version you're currently running, a new "Database upgrade" installation would need to be performed to re-upgrade the data contained in the restored database. (Not just the version number in the config table; upgrade processing is needed to fix-up or expand schemas and data for other purposes which are new to the later version of phpBB, too.)
Joyce&Luna wrote:
Tue May 07, 2019 11:05 pm
The error must already have been in phpBB 3.2.6.
You are correct. The change to remove the ability to "Download" backup files first appeared in phpBB 3.2.6, and that is when this "unable to restore" issue first appeared, too.

User avatar
Joyce&Luna
Registered User
Posts: 263
Joined: Wed Oct 14, 2015 3:46 pm
Location: Germany
Name: Anke
Contact:

Re: Database backup restore invalid

Post by Joyce&Luna » Tue May 07, 2019 11:40 pm

The backup comes from the phpBB version 3.2.7
I wanted to create a clone forum.
My contributions are translated from German to English by google. This can lead to misunderstanding.

phpBB Style Design

User avatar
EA117
Registered User
Posts: 755
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Database backup restore invalid

Post by EA117 » Wed May 08, 2019 12:04 am

Joyce&Luna wrote:
Tue May 07, 2019 11:40 pm
Joyce&Luna wrote:
Tue May 07, 2019 11:05 pm
The backup from Store can be uploaded with phpMyAdmin.
But the phpBB version jumps back to phpBB 3.2.5.
The backup comes from the phpBB version 3.2.7
Not if the version in the config table was 3.2.5 upon restore. Neither phpBB's database backup, nor phpBB's or phpMyAdmin's database restore, will override or change the stored version number in the database or in the backup files.

The simple explanation would be "there actually are phpBB 3.2.5 database backups in my /store directory too, and I was actually selecting one of those older phpBB 3.2.5 backups during restore."

The seemingly less likely explanation for "I installed phpBB 3.2.7 but then a backup and subsequent restore of my database shows phpBB 3.2.5 as the database version" would be if the phpBB 3.2.7 update process had actually failed. Meaning phpBB 3.2.7 was never actually successfully set as the database version, even though the phpBB 3.2.7 files were on your board when creating the backup.

You can check any backup yourself by opening the .sql file in a suitable text editor and searching for the phpbb_config table data (or whatever your correct table prefix is) and finding the "version" row's config_value field. For example, ('version', '3.2.7', 0). If you made .tgz or other compressed backups, the .sql file is what's inside that compressed archive.

Post Reply

Return to “[3.2.x] Support Forum”