[EP-tech] Reset an archive before going live

Yuri yurj at alfa.it
Mon Nov 5 08:10:49 GMT 2018

Il 01/11/18 19:12, John Salter via Eprints-tech ha scritto:
> Hi Yuri,
> Have you configured any metadata field via the web interface? [SELECT COUNT(*) FROM mf;].

Hi John!

MariaDB [myserver]> SELECT COUNT(*) FROM mf;
| COUNT(*) |
|        0 |
1 row in set (0.00 sec)

I've customized only phrases and templates and added some fields.

> If you haven't, then I think these steps:
> Bin/export subjects
> bin/epadmin erase_data
> bin/epadmin create_db
> import subjects


   epadmin erase_data repository_id

Erases and recreates the database. Removes all documents and files. Does 
not touch the configuration files.

It already recreate the database, why should I run "epadmin create_db"?

> You could either:
> - create a copy of the epadmin script, and add the 'user' dataset to the erase_eprints datasets
> or
> - manually remove all user* tables from the database, and then run:
> UPDATE counters SET counter=0 WHERE countername = userid;

I think this is the safer way.

> Then run:
> bin/epadmin update ARCHIVEID
> which I *think* should create all the tables necessary.

Why create the tables? They're already there and clear_table just do a 

sub clear_table
     my( $self, $tablename ) = @_;

     my $sql = "DELETE FROM ".$self->quote_identifier($tablename);
     $self->do( $sql );

The tablename came from a match of the table name with the datasetid on 

     foreach my $table ( @tables )
         next unless( $table =~ m/^$datasetid/ );
         print "Erasing table $table\n" if( $noise >= 2 );

More information about the Eprints-tech mailing list