WordPress.org

Ready to get started?Download WordPress

Forums

BackWPup Free - WordPress Backup Plugin
[Plugin: BackWPup] Rackspace Cloud backup from godaddy... (2 posts)

  1. Tim Gary
    Member
    Posted 3 years ago #

    More godaddy issues.. I'm guessing some library or function is disabled by godaddy, but maybe there's just a bug someplace.

    When attempting to save a backup to the rackspace clud service, I get this log

    2010-11-05 11:12.54: Run Database Dump to file...
    2010-11-05 11:12.54: Dump Database table: wp_commentmeta
    2010-11-05 11:12.54: Dump Database table: wp_comments
    2010-11-05 11:12.54: Dump Database table: wp_contact_form_7
    2010-11-05 11:12.54: Dump Database table: wp_headway_elements
    2010-11-05 11:12.54: Dump Database table: wp_headway_leafs
    2010-11-05 11:12.54: Dump Database table: wp_headway_misc
    2010-11-05 11:12.54: Dump Database table: wp_headway_options
    2010-11-05 11:12.54: Dump Database table: wp_links
    2010-11-05 11:12.54: Dump Database table: wp_options
    2010-11-05 11:12.54: Dump Database table: wp_postmeta
    2010-11-05 11:12.54: Dump Database table: wp_posts
    2010-11-05 11:12.54: Dump Database table: wp_stray_quotes
    2010-11-05 11:12.54: Dump Database table: wp_term_relationships
    2010-11-05 11:12.54: Dump Database table: wp_term_taxonomy
    2010-11-05 11:12.54: Dump Database table: wp_terms
    2010-11-05 11:12.54: Dump Database table: wp_usermeta
    2010-11-05 11:12.54: Dump Database table: wp_users
    2010-11-05 11:12.54: Database Dump done!
    2010-11-05 11:12.54: Add Database Dump to Backup: xxxxxxxxxxxxxxxxx.sql 932.07 KB
    2010-11-05 11:12.54: Create Backup Zip file...
    2010-11-05 11:12.55: Backup Zip file create done!
    2010-11-05 11:12.55: Connected to Rackspase ...
    2010-11-05 11:12.56: [ERROR] Rackspase Cloud API: Required Content-Type not set
    2010-11-05 11:12.56: Backup Archive File size is 96.55 KB
    2010-11-05 11:12.56: Job done in 2 sec.

    So, I take it RaceSpace requires a MIME content type (application/zip) in this example, but it's not getting it. I spent a little time looking through the code, and nothing popped out at me.

    What I'm thinking/hoping, is that there's a way to set the MIME content type from the BackWPup code instead of letting the Rackspace library functions try and determine it (since godaddy's probably disabling something that's used there). Since the type is known based on the BackWPup job settings (zip, tar, tar.gz, etc), this would seem to be a perfect fix in all cases, not just godaddy. It would also be faster than looking things up in the largish "magic" file from the rackspace library.

    Started looking at how to do this, but it will take more time than I have at the moment to familiarize myself with the code and calling conventions to see if it's even possible.

    Ideas? (w/code preferred ;-)

    Thanks,
    Tim

  2. Tim Gary
    Member
    Posted 3 years ago #

    Followup: I was able to get it working by replacing the backwpup/app/libs/rackspace directory with the contents of the updraft plugin's "cloudfiles" directory.

    No other changes were made, and I verified clean "rackspace" directory from 1.3.6 extraction.

    In comparing the cloudfiles.php source, there are a couple of differences. The one which I'm guessing fixed this on this server is a section:

    if(!$this->content_type && !function_exists("mime_content_type") && !function_exists("finfo_open") && is_file((string)$handle)) {
                $mimetypes = file_get_contents(dirname(__FILE__).'/share/mime.types');
    
                preg_match_all('/([a-zA-Z0-9+\/\-.]+)\t+([a-zA-Z0-9\ ]+)/',$mimetypes,$matches);
                foreach($matches[2] as $key=>$suffixes) {
                    $suffixArr = explode(' ',$suffixes);
                    foreach($suffixArr as $value) {
                        $mimeMapping[$value] = $matches[1][$key];
                    }
                }
                $basename = explode('.',basename($handle));
                $suffix = array_pop($basename);
                $this->content_type = $mimeMapping[$suffix];
            }

    Which was placed just AFTER this, in lines near the 1600's

    if (!$this->content_type && (string)is_file($handle) && function_exists("mime_content_type")) {
                $this->content_type = @mime_content_type($handle);
            }

    Guessing finfo_open and mime_content_type are unavailable to godaddy customers.

    Not sure I like this hack since it's made to the rackspace API code, and checking the current version of that code, it's not included.

    That brings me back to wondering if there's a way to specify the MIME content type from outside their php api code.

    Thoughts?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags