EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #07550


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Reset an archive before going live


Hi Yuri,
Have you configured any metadata field via the web interface? [SELECT COUNT(*) FROM mf;].
If you haven't, then I think these steps:
Bin/export subjects
bin/epadmin erase_data
bin/epadmin create_db 
import subjects


If you have used the web interface to create metadata fields, I think the following might be better:
~/bin/epadmin erase_eprints ARCHIVEID

This runs the following section: https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints%2Fblob%2F3.3%2Fbin%2Fepadmin%23L1469-L1507&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C60630345261e40fd622808d640259f7a%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=jQ4X%2BHwmo9nkVf6sk3Ih05tru2wVADI9WOggMYmlCSM%3D&amp;reserved=0

This will get rid of tables for:
	eprint
	history
	access
	request
	document
	file
	triple
But *not* user, subject, metafields (or other custom DataObjs).

Looking at how the 'reset_dataset' works, it deletes all rows, and then resets the counters.

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;


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

It might be worth checking whether there is data in any other tables - like the 'message' table.

Hope that helps somewhat - not the most coherent set of instructions I've ever written!
Cheers,
John


-----Original Message-----
From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Yuri via Eprints-tech
Sent: 31 October 2018 07:41
To: EPrints.org Technical List <eprints-tech@ecs.soton.ac.uk>
Subject: Re: [EP-tech] Reset an archive before going live

Forgot to mention, it is an eprints 3.15

Il 31/10/18 08:34, Yuri ha scritto:
> Hi!
>
>  we're ready to go to production with a new archive. What I want to do 
> is:
>
> - remove all eprints, documents and users we have
>
> - leave all config, plugins and phrases untouched
>
> - leave the subject in place
>
> I could dump the subjects, do an epadmin erase_data and reimport the 
> subjects. Then I think I've to add an admin account with epadmin 
> create_user and It should be done. What about customized phrases or 
> web edited configs/phrases?
>
> Is this the way to go?Or better anepadmin erase_eprints and then 
> deleting all users by hand (and maybe reset the counter for the users 
> - if there's any)?
>
>

*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C60630345261e40fd622808d640259f7a%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=yAHT%2Bk2xLi%2B1XmkE06Kq4uDbBpjsi2nQVS5BiluKJKI%3D&amp;reserved=0
*** EPrints community wiki: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C60630345261e40fd622808d640259f7a%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=qhuszc6kowmhwnN1I5i1jzWhnXaPIF3OBWH8SuG5Mtc%3D&amp;reserved=0
*** EPrints developers Forum: https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C60630345261e40fd622808d640259f7a%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=vSdwb1JksBdIsEyRtyIL%2FvtO3fePBdLMfLxXZO%2BYHGo%3D&amp;reserved=0