Title: Help with SQL Backup / Demo Content
Last modified: August 30, 2016

---

# Help with SQL Backup / Demo Content

 *  [joergf](https://wordpress.org/support/users/joergf/)
 * (@joergf)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/help-with-sql-backup-demo-content/)
 * Hi people. I’v got a Theme wich comes with alternative demo content. there is
   a folder “uploads” with stuff for wp-content/uploads and a installer. the installer
   has only a .sql and .php inside, so i think it just chnges paths to the correct
   ones of my site.
 * iv got an ssl protocol installed. when i start the installer for the demo content,
   it destroys my wp setup. after it generate links like “[https://https//mydomain.com/………&#8230](https://https//mydomain.com/………&#8230);.”
   and i cant access any site.
 * i attached the code of the installer
    so my quastions / options:
 * how to fix the installer, so it wont destroy my setup and generate links correctly?
 * or how to install content manually, what i have to change in phpmydamin. maybe
   a coder can read it out of the code.
 * Thanks in advance.
 * `
    global $wpdb; $our_site_url = get_site_url(); $our_site_url = str_replace(‘
   [http://&#8217](http://&#8217);, ”, $our_site_url); replace_file(dirname(__FILE__).’/
   demo.sql’, ‘flowmaster.themes.zone’, $our_site_url); replace_file(dirname(__FILE__).’/
   demo.sql’, ‘tz_’, $wpdb->prefix);
 *  $query = “”;
    $sql = file(dirname(__FILE__).’/demo.sql’); foreach ($sql as $
   key=>$line) { $line = trim($line); if ($line != “” && substr($line, 0, 2) != ‘–‘){
   $query .= $line; if (substr($line, -1) == ‘;’) {
 *  $query_result = $wpdb->query($query);
    if ($query_results === FALSE) { echo(
   $query); } $query = “”; } } } unset ($line);
 * function replace_file($path, $string, $replace)
    {
 *  if (is_file($path) === true)
    { $file = fopen($path, ‘r’); $temp = tempnam(dirname(
   __FILE__), ‘tmp’);
 *  if (is_resource($file) === true)
    { while (feof($file) === false) { file_put_contents(
   $temp, str_replace($string, $replace, fgets($file)), FILE_APPEND); }
 *  fclose($file);
    }
 *  unlink($path);
    }
 *  return rename($temp, $path);
    }

Viewing 1 replies (of 1 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/help-with-sql-backup-demo-content/#post-6418827)
 * What is the name of the theme, and where did you get it from?

Viewing 1 replies (of 1 total)

The topic ‘Help with SQL Backup / Demo Content’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/help-with-sql-backup-demo-content/#post-6418827)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
