Jump to content

Unable to import database


Recommended Posts

A slightly odd case this:

I have a WSL/Docker/ddev setup that has been working very well. Then, for no apparent reason, Docker Desktop failed to start the docker engine. I tried all the suggested fixes without success so decided to uninstall it and run Docker from within WSL instead. After successfully doing that, I found that the db was empty so PW would not run. I imported a recent backup database from the production site into the empty db using phpMyAdmin and it appeared to be OK. However, on running the PW site, I got a 500 error. I tried importing an old dev backup and that worked OK.

So, now I had PW running in dev, but not with the latest database. I then tried to use the PW backup tools to download the latest version from the live site and upload it into the dev site and got the following message after clicking 'upload':

ProcessDatabaseBackups: File could not be downloaded (https://[Database path].sql) 403 Forbidden: (tried: curl)

Any idea what might be causing this and how to fix it? At the moment I am stuck without being able to work on a current database version and can't get it successfully imported via either phpMyAdmin or PW.

One thing that looks rather odd is that the message says it can't be downloaded (not uploaded) and that the database path given is a path to site/assets/files on the LIVE site.

EDIT: Also, I see that the uploaded backup IS listed on the backups page. However, restoring it results in errors*. All a bit random and confusing!

* The error appear to be because not all modules are loaded. Commenting out the calls and refreshing the modules seems to fix this.

Link to comment
Share on other sites

On 4/2/2023 at 2:13 AM, wbmnfktr said:

It's perfectly fine within a running setup but once in a while it's not working as expected.

Added a fix for the on-demand mirroring at the beginning of the hook:

		//Don't execute for backups!!
		$backtrace = DEBUG::backtrace();
		foreach($backtrace as $item) {
			if(strpos($item['file'], 'ProcessDatabaseBackups')) return;


  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...