--

CommentFileSizeAuthor
#4 532678-update.patch3.5 KBboombatower

Comments

boombatower’s picture

Assigned: Unassigned » boombatower

Working on (have been).

boombatower’s picture

Reset script.

if (isset($_GET['restore'])) {
  header('Content-Type: text/plain');
  ini_set('display_errors', 1);
  set_time_limit(0);

  echo "resetting...\n";

  db_query('TRUNCATE TABLE {watchdog}');

  db_query("UPDATE {system}
            SET schema_version = %d
            WHERE name = '%s'", 6000, 'pift');

  $tables = array(
    'pift_data',
    'pift_test',
    'pift_project',
  );
  $ret = array();
  foreach ($tables as $table) {
    if (db_table_exists($table)) {
      db_drop_table($ret, $table);
    }
  }

  echo "importing d.o dataset...\n";

  $parts = parse_url($db_url['default']);
  $command = "mysql -u{$parts['user']} -p{$parts['pass']} " . substr($parts['path'], 1);
  exec($command . ' < /home/boombatower/download/pift_data.sql');

  echo "finished...\n";

  print_r($ret);

  exit;
}
boombatower’s picture

t.d.o dump script:

if (isset($_GET['pifr_dump'])) {
  $result = db_query('SELECT file_id, server_file_id FROM {pifr_file}');
  $dump = '';
  $count = 0;
  while ($file = db_fetch_array($result)) {
    $dump .= $file['file_id'] . ',' . $file['server_file_id'] . "\n";
    $count++;
  }
  file_put_contents('files.dump.txt', $dump);
  drupal_set_message('Dumped: ' . $count);
  exit;
}
boombatower’s picture

Status: Active » Needs review
StatusFileSize
new3.5 KB

Cleaned it up a bit and confirmed it works on d.o data...I don't have files tables and such to be 100% sure...not sure how to proceed there as I think we want to be 100%. Regex removes link properly!

boombatower’s picture

Status: Needs review » Fixed

I'll just plan on deploying to d6.d.o and checking 100% there...as I think was the original plan.

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.