post-page

Now restore and backup in the same script!

8
responses
by
 
on
December 31st, 2003
in
WordPress Hack

I have made some changes to the WordPress Backup procedure and added the Restore script to it. Now you have the ability to backup your MySql database and download it locally, backup your WordPress folder and download it locally, and restore your MySql database, all from the comfort of a web interface (which can be integerated into the WP admin interface). There is added password protection thrown in as well.
I had the nasty fortune of using my own backup and restore script this morning which forced me to code some bugfixes and finally emerged into a completely different way of backing up and restoring.

Please download the new version from the same link.

This has not been tested on a Windows web server (and I am not sure if the applications that I use are present in a Windows/MySql installation, but I need some feedback)

Please let me know what you think.
Peace

#EDIT#
Some updates have been added to the original backup and restore hack for WordPress by Dean from http://www.dean-logan.com
These include:
Backup/restore link in the admin-footer
Code to make it so only a certain user level could see the link.
The layout is the same as the other admin pages. Simply added the admin-header.php include and the admin-footer.php include, put div’s with wrap around the outputs and changed some of the tags.

Download the new backup restore files here.

heading
heading
8
Responses

 

Comments

  1. Beel says:

    I have been using your backup hack for quite some time, but just recently lost the ability to connect to database with 1.3. Have you by chance tested it in 1.3 and know the fix? Otherwise I will dig into it sometime and see if I can come up with a solution.

  2. Beel says:

    Nevermind, it was easy enough, just deleted the globals and did some renaming as:
    $server = DB_HOST;
    $loginsql = DB_USER;
    $passsql = DB_PASSWORD;
    $base = DB_NAME;
    are no longer available in wp-config

  3. alex says:

    I think it would make sense to integrate WordPress’ user authentication into this.

  4. Mark says:

    I had thought about putting 2 and 2 together as well, but this was so simple. 🙂 If enough people show interest in it again, Ill spend some more time on it.

  5. Dean says:

    I am using your backup and restore script on my WP blog.
    Instead of putting the link in the edit-form, I put it in the admin-footer.php file. I also added a little code to make it so only a certain user level could see the link.

    5)
    echo " — < a href="http://www.dean-logan.com/blog/wp-admin/backup_restore.php" />Backup & Restore< /a>";
    ?>

    I’m also going to add the restriction to the individual backup pages, incase someone would bypass the link.

    On another note. I modified the pages, so the layout would be the same as the other admin pages. I simply added the admin-header.php include and the admin-footer.php include, put div’s with wrap around the outputs and changed some of the tags. If you want the file updates, let me know.

  6. Dean says:

    <?php if ($user_level > 5)
    echo "&nbsp;&#8212;&nbsp;<a href=\"http://www.dean-logan.com/blog.....estore.php\" />Backup &amp;
    Restore</a>";
    ?>

    errr… html messup

  7. Mark says:

    Hey thanks Dean!! I am sure a lot of users will appreciate your modifications! If you would not mind, could you do small write up in a text file and email it to me? I will add it to the hack zip file.
    Thanks again!

  8. sandro says:

    just an FYI, the 2nd download link is incorrect; it currently links to a php page (and a 404) and should link to a zip file:
    http://weblogtoolscollection.c.....ackup1.zip



Obviously Powered by WordPress. © 2003-2013

css.php