Ruchi arora
Ruchi arora

Reputation: 113

How to restore PostgreSQL database to initial state as it was after fresh install

I am using PostgreSQL as a database for DSpace project. I am inserted some records in tables now i want a script with the help of which the database become empty only it contains the data in that table which is automatically inserted during fresh install.

Upvotes: 2

Views: 978

Answers (2)

محسن عباسی
محسن عباسی

Reputation: 2444

Just execute the following commands in your SSH terminal:

[dspace]/bin/dspace database clean
[dspace]/bin/dspace database migrate

[dspace] is installation path of Dspace (e.g. /root/Dspace/installed/5.3) which is defined in the configuration file: dspace.cfg If you want to return your database to a fresh install state, just run the following command instead of the second one above:

[dspace]/bin/dspace database migrate ignored

Upvotes: 0

schweerelos
schweerelos

Reputation: 2189

[dspace]/bin/dspace database clean
[dspace]/bin/dspace database migrate

Swap in your actual DSpace install directory for [dspace].

According to the official DSpace documentation:

running "dspace database clean" followed by "dspace database migrate" will return your database to a fresh install state

Upvotes: 1

Related Questions