You are here:  » Exporting and Importing Reviews


Exporting and Importing Reviews

Submitted by chrisst1 on Tue, 2014-02-18 11:42 in

Hi David

I'm looking at exporting reviews from old pt databases and importing into new databases. So far using myphpadmin i've exported but when re-importing I get an error as the ID's are wrong. Could you advise which would be the easiest way to do this.

Thanks

Chris

Submitted by support on Tue, 2014-02-18 11:53

Hi Chris,

Here's how to extend the Database Tool to export / import Reviews. In admin/database_tool.php look for the following comment at line 20:

  // feeds

...and REPLACE with:

  $fields["reviews"][] = "created";
  $fields["reviews"][] = "approved";
  $fields["reviews"][] = "product_name";
  $fields["reviews"][] = "rating";
  $fields["reviews"][] = "comments";
  // feeds

Then look for the followign code at line 159:

    if (isset($_POST["feeds"]))

...and REPLACE with:

    if (isset($_POST["reviews"]))
    {
      $xml .= database_toolDumpTable("reviews");
    }
    if (isset($_POST["feeds"]))

And then the following code at line 237:

    $table = "feeds";

...and REPLACE with:

    $table = "reviews";
    $first = TRUE;
    MagicParser_parse("string://".$xml,"myRecordHandler","xml|BACKUP/REVIEWS/REVIEWS_R/");
    $table = "feeds";

And finally the following code at line 301:

  print "<input type='checkbox' name='feeds' id='feeds' checked='checked' /> <label for='feeds'>Feed Registration, Filters, Global Filters</label><br />";

...and REPLACE with:

  print "<input type='checkbox' name='reviews' id='reviews' checked='checked' /> <label for='reviews'>Reviews</label><br />";
  print "<input type='checkbox' name='feeds' id='feeds' checked='checked' /> <label for='feeds'>Feed Registration, Filters, Global Filters</label><br />";

Cheers,
David.
--
PriceTapestry.com

Submitted by chrisst1 on Fri, 2014-02-21 14:58

Thanks David

I'll give that a go over the weekend.

Chris