Nice work LL! :-)
Nice work LL! :-)
@Karl: If you are still with me, try this:
Find this line (in 4 places) in backupRestore.php:
and replace with this line:
I'm still here :)
I am getting the same error:
Warning: main(admin-header.php): failed to open stream: No such file or directory in /home/public_html/backup/backupRestore.php on line 132
Fatal error: main(): Failed opening required 'admin-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/backup/backupRestore.php on line 132
backupRestore.php needs to be in your wp-admin folder with this new version. From the error it looks as if you might have it in a folder called "backup".
:-P Sweet! I missed that backup folder thing as well! Thanks MtDewVirus!
I backup my folder and database every few days, download the backups from the server and then delete them to save space. If I ever need to restore I'll just upload the sql file first. :-)
sighz, my server doesn't have mysqldump in the path and I do not know the path =(
all doesn't work
Karl, unless you upload a lot of stuff (like pictures, add hacks etc) to your blog, the files do not get changed much. Thus a file backup is not necessary all that often. There are ways to force a download of the file and then delete it off the server, but I did not think that would be as useful. Just as MtDewVirus suggested, download the backups to your local computer and delete them off the server when they get too large in numbers.
Hi Nick and LaughingLizard (sorry don't know your name :)),
That makes good sense.
which mysql gives me : /usr/bin/mysql. so the dump is at /usr/bin/mysqldump ?
@gamerz: I am sorry, I should have said:
echo passthru("whereis mysqldump");
Normally mysqldump is in the same search path as mysql. Try running the which mysqldump or whereis mysqldump.
@LaughingLizard: For some reasons whenever I run passhtru or exec, it will give me The page cannot be displayed
@GamerZ: passthru (and other system exec commands) will not work when php is running in safe mode. The command will only execute programs which are physically located in the folder specified by the safe_mode_exec_dir directive.
If your server is running in safe mode, you could try to make a folder in your web directory and put all the mysql binaries into it. Then add this line to your .htaccess:
php_value safe_mode_exec_dir "/folder/where/mysqldump/is/localted"
However, I checked with your server and it is not running in safe mode. So, if you are still with me, find this line in your backupRestore.php:
echo passthru("mysqldump --opt -h$server -u$loginsql -p$passsql $base >$file_name");
and replace it with this one. Let me know if it works and I will fix the hack to reflect all of the passthru functions.
system("mysqldump --opt -h$server -u$loginsql -p$passsql $base >$file_name", $retval);
At some point, I'll look into just dumping the database through PHP, without the need for mysqldump... it's pretty easy, especially given my database-to-database backup works by dropping and inserting the data. All you need is the database template in place -- but I should be able to somehow grab the schema of all the tables too, and then loop through the tables. Mark, we should catch up on this idea at some point... ;)
I agree with you David. As a matter of fact, I was working on the php walkthrough of the databases to produce an sql export for an upcoming release. If you already have that done (or some part of it) we should collaborate.
The only issue is that the export has to be mysql import compatible. (or we can write a custom import script as well) The wonder of mysqldump is that the tables and all columns (and their features) are created automatically. However, considering the fact that a restore would be done after a vanilla install of wordpress, that is a non-issue.
Any reason not to just grab the code from phpMyAdmin?
I can't use it too, as functions: exec,system,dl,passthru,chown are disabled by my hosting provider (Dreamhost) for security reasons...
Everything seems to be working just fine . I'm told that the backup was succesful and that I can download the file from my backup-folder. But there is no *.sql file in the folder - most likely because I have to assign write permisson the backup-folder!
But how do I do that?
@alexkingorg: I am looking into that.
@anavy: Wait for the next version, that should have the workaround.
@martin: you can change permissions either through your ftp client (look for a right click menu or a button, I am not sure what you use and thus am no help) you could also ask your web provider for instructions.
Thanks for the tip!
I changed the permissions to chmod 777 for the backup-folder - and now I get a 404, when I try to access the *.sql-file - simply because no file is generated...!
You might have the same problem as some of the other people on this thread (exec, system diabled for security reasons)
Please wait for another update (soon...within a couple of weeks)
Will do! - and thanks again :-)
Does this mean, that there is no chance to move a blog from one server to another?
I'm new to WP and tried it on a different place. The backup "behaves" like Martin's (install OK, but no files in /backup)
@stip: Not at all!! This backup is just an integerated and convenient way of doing what you could with many many other tools. To move your blog from one domain to the other, you would copy all your files from your old domain to your local computer and then back to the new domain. Then you would use some MySql tool like phpMyAdmin (or anything else provided by your host, check with them) to backup your database. Then you would restore the database with the same (or some other tool) onto your new server. The fact that this particular backup/restore method does not work for you, does NOT mean you cannot backup. Sorry if I caused any confusion.
There have been some problems associated with "pasthru" for this backup script and there is an update to it which takes care of just that.
You can download it from here:
I would appreciate if bugs were posted on here.
All changes listed in the readme.txt
The backup11 seems to work perfectly fine for me (the 'old' version wouldn't write any files, i'm guessing it was the mentioned server 'safety' settings).
I've only used the backup feature so far though. I'll be switching servers this weekend, and will let you know how it goes.
Thanks for the wonderful work!
:) Thanks! Keep the feedback coming!
Just thought of something would make for a nice add-on to this great hack.
Where you list Database files in the backup directory...
What if the file names were links to the files so that they could be easily downloaded from within the WP Admin? What about also adding a link to delete each file?
Another idea...when you backup files, it includes the backup folder, so you may be backing up backups, backups of backups, etc. By doing this, the files could get rather large.
Is there a way to eliminate backing up the backup folder in this process?
First idea is easy, though delete would require a little bit of code (unlink the files)
Second idea is workable, but tougher to implement. I did have to wrangle with the code to prevent an infinite loop. ;-)
I will look into those, dont know when they will get done though.
This topic has been closed to new replies.