Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New restore in 1.30 fails with foreign key constraint error #6838

Open
clarkac1 opened this issue Jan 27, 2025 · 2 comments
Open

New restore in 1.30 fails with foreign key constraint error #6838

clarkac1 opened this issue Jan 27, 2025 · 2 comments

Comments

@clarkac1
Copy link

Description of the bug

After running update.php which included the new backup (see https://docs.backdropcms.org/documentation/creating-backups) I tried the restore. The restore failed with the message:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails

This was the only message I could find. The system was still usable and I guess had not been updated.

Steps To Reproduce

  1. Create a backup folder
  2. Add the line into settings.php in a 1.30 system to point to the backup folder
  3. Run an update which will create a backup. Be aware: If there is no backup to be done, no backup is created.
  4. Run example.com/core/restore.php

Actual behavior

The following message was produced:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails

Expected behavior

System should be restored to prior to the update done in 3. above

Additional information

Add any other information that could help, such as:

  • Backdrop CMS version: 130
  • Web server and its version: Apache 2.4.62
  • PHP version: 8.3.14
  • Database server (MySQL or MariaDB?) and its version: 10.6.19-MariaDB
  • Operating System and its version: Linux 3.10.0-962.3.2.lve1.5.81.el7.x86_64
  • Browser(s) and their versions: Firefox 134.0.2
@clarkac1
Copy link
Author

I should add that this (test) site has CiviCRM installed, sharing the same database. Is the new backup/restore going to work in that situation?

@indigoxela
Copy link
Member

indigoxela commented Jan 29, 2025

Is the new backup/restore going to work in that situation?

Probably not out of the box, but with some settings. Have a look at the code, as there's probably no detailed documentation available, yet: https://github.com/backdrop/backdrop/blob/1.x/core/includes/backup/backup.database.inc#L134

But the settings form isn't fully implemented yet...

When you run an update with backup, which doesn't need a backup... what do the backup files look like after that? The directory gets created? What's in it?

The restore seems to find them, but they're not usable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants