Hi there,

I've just tried a test backup and restore on my localhost, however, the database wasn't restored. I got the following warnings after browsing to the file to be restored via the backup and restore module:

warning: move_uploaded_file(/tmp/TestBackup-2009-05-06T18-53-55.sql_.gz) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\wamp\www\includes\file.inc on line 572.
warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpD707.tmp' to '/tmp/TestBackup-2009-05-06T18-53-55.sql_.gz' in C:\wamp\www\includes\file.inc on line 572.
File upload error. Could not move uploaded file.

Any ideas?

Comments

RichieRich’s picture

I get this too when I try to run my site locally. It works fine on my live site. I added the module to the live site and it worked fine so I downloaded my site to run it locally (I know that's probably the opposite of what you should do) but the backup and migrate module doesn't seem to want to play.

nirad’s picture

getting this too. i think there is some incompatibility with the way this module interacts with the directory structure under WAMP. I am using eaccelerator under WAMP as well, so it may be related to that...

-Nirad

b.c.’s picture

I get something similar. Going from local to remote site. Anyone find a solution?

I get:

* warning: move_uploaded_file(C:\xampp\tmp/MYSITE-2009-11-20T11-07-45.sql) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/content/m/o/u/USER/html/includes/file.inc on line 579.
* warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpBUmKYc' to 'C:\xampp\tmp/MYSITE-2009-11-20T11-07-45.sql' in /home/content/m/o/u/USER/html/includes/file.inc on line 579.
* File upload error. Could not move uploaded file.

juanzo007’s picture

Has there been any solution to this? I'm trying to migrate to a test server from a local MAMP stack. Incompatible database types? or do an import through phpmyadmin?

juanzo007’s picture

fyi, here's my error message... my guess its a permission problem on the server side. I've got all site permissions.

* warning: move_uploaded_file(/Applications/MAMP/tmp/php/SolarSentinel-2010-05-16T12-12-20.mysql) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/juanzo007/greatwall.jhasf.com/includes/file.inc on line 588.
* warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpruxLUc' to '/Applications/MAMP/tmp/php/SolarSentinel-2010-05-16T12-12-20.mysql' in /home/juanzo007/greatwall.jhasf.com/includes/file.inc on line 588.
* File upload error. Could not move uploaded file.

juanzo007’s picture

Duh. had to reset the temp source folder under site configuration>> file system. Onward...

Adam Dyga’s picture

Right, this probably happens if you build the site locally in one OS (eg. Windows) and then migrate it to a different OS (eg. Linux).
To successfuly restore a SQL file dumped by "Backup and Migrate" you have to first set proper temporary directory (admin/settings/file-system) on the target host. Then restore will work. But be careful, after restoring the temp dir has to be corrected again (on the target host).
Maybe "Backup and Migrate" should preserve this setting when restoring the DB?

nathan tsai’s picture

What do you mean by, "you have to first set proper temporary directory (admin/settings/file-system) on the target host." I got to the page but I don't know what you mean.

pfortuna’s picture

That worked for me...

maknet’s picture

Worked like a charm for me.

FYI for others (here's some keywords):
Live: Linux, apache, mysql, PHP (LAMP)
Local: W7, apache, mysql, php (WAMP)

Specifically, i am using WAMPSERVER and that was the main issue.

The other issue was the max file upload size. I was tearing my hair out editing:
/wamp/bin/php/php5.x/php.ini

When it SHOULD have been:
/wamp/bin/apache/apache2.x/bin/php.ini
!!

Hope that saves someone an hour of time.

SWMdave’s picture

IF you can't restore and you are receiving the error above try this.

First go to the file-system page under site configuration: (YOURURL/admin/settings/file-system)

See if the "Temporary Directory" is giving you and error that says " The directory does not exist"

or just check your drupal install and scope it out. If you see the error or don't see a folder "temp" its super easy. Stay on this page in your browser.

Just make a new directory (new folder) called "temp" in your install on the same level as the rest of your drupal install directories. drupal needs to see a "temp" directory.

now refresh the page---and Drupal will tell you the directory temp/tmp has been created. DONE!

Now you should be able to go over to backup and migrate and restore from your backup.

The big error is mainly just an error that says there is a missing temp directory. Could happen with MAMP, WAMP or XAMPP.

PoidsTotal’s picture

I have such error, It got away when I change the permission of the tmp folder. For me it set to sites/default/files/tmp

talarkadeh’s picture

I want to install a backup manually.
Where is the database information file? I want to edit it and put the database information