Getting "Restore failed…" error message, from UpdraftPlus
-
Hello. I was trying to restore theme files from a backup, but UpdraftPlus returned the following:
————–
Unpacking backup…
Error message: Could not create directory.Restore failed…
—————
That “Could not create directory” message, is making me wonder if this problem may have something to do with the fact that I’m on a Windows server (like this is some permissions thing- the program is trying to create a directory but for some reason the Windows configuration isn’t allowing it?) Well any insight that you could provide, would be much appreciated- thanks.
-
Hi CarynG,
Yes, that message usually means that WordPress doesn’t have permissions to write in the relevant directory. You need to check that the directories wp-content and wp-content/upgrade (if it exists yet) are writable by your web server.
David
Thank you so much for your prompt reply, David. Well, I checked and those 2 directories do have write permissions assigned, as far as I can tell (from checking the “Securities” tab of the “Properties” dialog, for those directories… is there perhaps anything more specific that you can recommend, if I’m not on the right track here?)
Hi CarynG,
It’s got to be permissions-related in some way – the place in WordPress where that error message appears is upon checking the success of a mkdir (“make directory”) command. It may be that the write permissions are not assigned for the same user as PHP/IIS is running as on the server – i.e. that some user has write permissions, but not the write one. Are you using IIS as your web server? This may help: http://support.microsoft.com/kb/313075
David
David, thanks again for answering. Yes, the server is using IIS. I don’t think it’s that the write permission isn’t set for the particular user that write permission needs to be set for (the PHP user)- I followed the instructions given on this here page that I found:
http://serverfault.com/questions/105420/which-user-does-php-iis6-use-to-read-write-files
and I uploaded that test.php file to get the PHP username from the output of phpinfo(), and this username does have write permissions for both the wp-content and wp-content/upgrade directories. So could you maybe check your code to see what other directories it may be trying to create, in the process of trying to restore files from the backup- maybe it’s actually some other directory that I need to give the write permission to for the PHP user? Or maybe I can just manually create that directory myself? (Yea, aren’t problems of this nature the most aggravating? And these are the problems I always seem to get!) 🙂 Thanks again so very much- I really want to use your backup plugin for my site because it seems like the best one out there (and I wonder if I try to use some other backup plugin, that I’d just run into the same problem with any other plugin I try, so I think I really just need to solve this fundamental issue with the write permissions).
Hi there, I am wondering: Did you try to do this Restore by FTP or on your WordPress Dashboard?
Hi. I was just trying to do the restore by clicking on the big blue “Restore” button, that’s at the top of the UpdraftPlus page in the WordPress back-end of my site.
Thanks. Got that. Maybe you can save your site by re-uploading your latest backup Database file. That usually fixes most problems.
This means you need to go to your HOST Controlpanel (Not WordPress)
Once on your Host, go to MySql and go to the database that is affected. Once on there, click on IMPORT and upload the Darabase file from your last backup ( Have you saved that file to your FTP or computer? ) If you have not downloaded it, you might still be able to download it from the FTP server. The re-install.. Hope this helps. Cheers.Hi CarynG,
At this stage:
Unpacking backup…
Error message: Could not create directory.… the only directory its trying to create is inside wp-content/upgrade/ (not that dir itself, but one inside there).
The other possibility is that perhaps the directory name it is trying to create is too long, or has non-standard characters in it. (This is just me trying to guess what the problem could be). If you can wait a bit I will create a version of UD that eliminates those two possibilities (it won’t be today).
David
Hi David, so your WordPress site is still working and you can login etc.. ? Maybe the problem lies somewhere else. ?
Hi again. David, hartmutnz, just to clarify: my site is actually fine (but thanks for the concern, very nice of you. 🙂 ) So the deal is, I’m in the process of developing a new site, and “get backup mechanism for it” was just one of the items on my long “to do” checklist… So I created a test site on the same server, installed the UD plugin on the test site, did a backup, and then I went and deleted some tables from the WordPress database, and I deleted a bunch of files from my test site’s theme directory, and then I did the restore to test to see if it made everything whole again like it’s supposed to, and the database actually got restored just fine, but I got that error when it attempted to restore the files. So fortunately I wouldn’t say this is a crisis situation (so David, yes- I can wait for your new UD version which may address this, hopefully), but it was still a bummer to run into this problem (I was expecting this whole exercise to be very routine and simple, so I can move right along to finishing the actual development of the site, but alas no such luck for me.) Well thanks again for your kind help, and when your new UD version is ready, please let me know.
Hi understand, I am trying the same right now….
So check out WORDPRESS MOVE , I am checking this out at the moment, talk later 🙂Hi CarynG,
Here’s something you can do to test your WordPress setup on this problematic site:
1) Create a file, called z.php (actually anything ending in .php) and put it in the root folder of your WordPress install. Contents of file:
<?php require('wp-load.php'); $x = mkdir(WP_CONTENT_DIR.'/upgrade/'); var_dump($x); $y = mkdir(WP_CONTENT_DIR.'/upgrade/testing'); var_dump($y); ?>2) Then visit that file in your browser, i.e. go to (having changed the URL to match your site):
3) Then please tell me what the output is!
If it shows errors and/or says “false”, then you’ve got a file permissions problem. If not, then the problem is elsewhere.
David
Yes, this was a great test to try. Here’s what the output of z.php was:
bool(false) bool(true)
But that first “false” I believe is because the upgrade directory already existed. The “testing” subdirectory had not been there before though, but after I ran z.php, I saw that this subdirectory had been successfully created on the server (and hence the “true” in the output, for the second variable). And then right after I ran z.php, I went to try to do the restore again (to check to see if that problem was still there), and I am still getting the “Could not create directory” error message unfortunately. So, if you’re absolutely certain that the UD plugin is not trying to create any directories anywhere else but under wp-content/upgrade, then perhaps your guess may be right, that my server just doesn’t like the given name of the new directory that it’s trying to create?
Hi CarynG,
I’ve just looked more closely at the code where this error message is…
Oops, sorry – pressed the wrong button!
* * *
Hi CarynG,
I’ve just looked more closely at the code where this error message is…
The unpacking of the zip is outsourced to WordPress – UpdraftPlus just calls WP’s routine to unpack a zip (the same one used when you install any plugin/theme). That’s meant to be the most reliable way!
I feel pretty skeptical that it’s the long file name, because I think we’d be seeing more reports of the problem. It’s not *that* long (about 60 characters, usually – though perhaps you can check manually? Have a look in wp-content/updraft – it bases off the file names you see in there).
I’m wondering if the zip file is corrupt. Could you forward it to contact@updraftplus.com?
David
The topic ‘Getting "Restore failed…" error message, from UpdraftPlus’ is closed to new replies.