WordPress.org

Ready to get started?Download WordPress

Forums

WP Backup/Restore new version (77 posts)

  1. Nick Momrik
    Member
    Posted 10 years ago #

    Nice work LL! :-)

  2. Laughinglizard
    Member
    Posted 10 years ago #

    Thanks MtDewVirus!!
    @Karl: If you are still with me, try this:
    Find this line (in 4 places) in backupRestore.php:
    require_once ('./admin-header.php');
    and replace with this line:
    require_once ('admin-header.php');

  3. KarlB
    Member
    Posted 10 years ago #

    Hi there,
    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
    thanks
    Karl

  4. Nick Momrik
    Member
    Posted 10 years ago #

    Karl,
    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".

  5. Laughinglizard
    Member
    Posted 10 years ago #

    :-P Sweet! I missed that backup folder thing as well! Thanks MtDewVirus!

  6. Nick Momrik
    Member
    Posted 10 years ago #

    Karl,
    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. :-)

  7. Lester Chan
    Member
    Posted 10 years ago #

    sighz, my server doesn't have mysqldump in the path and I do not know the path =(
    I tried
    /usr/bin/mysql
    /usr/lib/mysql
    /usr/share/mysql
    /usr/share/man/man1/mysql.1.gz
    all doesn't work

  8. Laughinglizard
    Member
    Posted 10 years ago #

    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.

  9. KarlB
    Member
    Posted 10 years ago #

    Hi Nick and LaughingLizard (sorry don't know your name :)),
    That makes good sense.
    Thanks again.
    Karl

  10. Lester Chan
    Member
    Posted 10 years ago #

    @LaughingLizard:
    which mysql gives me : /usr/bin/mysql. so the dump is at /usr/bin/mysqldump ?

  11. Laughinglizard
    Member
    Posted 10 years ago #

    @gamerz: I am sorry, I should have said:
    <?php
    echo passthru("whereis mysqldump");
    ?>
    Normally mysqldump is in the same search path as mysql. Try running the which mysqldump or whereis mysqldump.

  12. Lester Chan
    Member
    Posted 10 years ago #

    @LaughingLizard: For some reasons whenever I run passhtru or exec, it will give me The page cannot be displayed

  13. Laughinglizard
    Member
    Posted 10 years ago #

    @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);
    echo $retval;

  14. davidchait
    Member
    Posted 10 years ago #

    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... ;)
    -d
    http://www.chait.net

  15. Laughinglizard
    Member
    Posted 10 years ago #

    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.

  16. Alex King
    Member
    Posted 10 years ago #

    Any reason not to just grab the code from phpMyAdmin?

  17. Anavy
    Member
    Posted 10 years ago #

    I can't use it too, as functions: exec,system,dl,passthru,chown are disabled by my hosting provider (Dreamhost) for security reasons...

  18. martin_hoegh
    Member
    Posted 10 years ago #

    Dummie query:
    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?

  19. Laughinglizard
    Member
    Posted 10 years ago #

    @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.

  20. martin_hoegh
    Member
    Posted 10 years ago #

    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...!
    Any ideas?

  21. Laughinglizard
    Member
    Posted 10 years ago #

    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)

  22. martin_hoegh
    Member
    Posted 10 years ago #

    Will do! - and thanks again :-)

  23. stip
    Member
    Posted 10 years ago #

    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)

  24. Laughinglizard
    Member
    Posted 10 years ago #

    @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.

  25. Laughinglizard
    Member
    Posted 10 years ago #

    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:
    http://dinki.mine.nu/word/b2-img/wp_backup11.zip
    I would appreciate if bugs were posted on here.
    All changes listed in the readme.txt

  26. BillW
    Member
    Posted 10 years ago #

    LaughingLizard::
    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!

  27. Laughinglizard
    Member
    Posted 10 years ago #

    :) Thanks! Keep the feedback coming!

  28. Nick Momrik
    Member
    Posted 10 years ago #

    LL,
    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?
    -Nick

  29. Nick Momrik
    Member
    Posted 10 years ago #

    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?

  30. Laughinglizard
    Member
    Posted 10 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags