reset pager.page if needed
[angular-drzb] / migrate-db.pl
index a630d08..b228eec 100755 (executable)
@@ -8,7 +8,7 @@ use Data::Dump qw(dump);
 my $ua = Mojo::UserAgent->new;
 
 my $from = 'http://10.60.0.95:5984/drzb2013';
-my $to   = 'http://10.60.0.92:5984/drzb2013';
+my $to   = 'http://10.60.0.95:5984/drzb2013v2';
 
 my $docs = $ua->get("$from/_all_docs?include_docs=true")->res->json;
 
@@ -66,7 +66,7 @@ foreach my $doc ( map { $_->{doc} } @{ $docs->{rows} } ) {
        my $id = $new->{_id} || die "no _id in new";
        my $result = $ua->put("$to/$id" => Mojo::JSON->new->encode( $new ))->res->json;
 
-       die "ERROR $id ",dump($result) unless $result->{ok};
+       die "ERROR $to/$id ",dump($result) unless $result->{ok};
 
        warn "SAVED $id into $to\n";