[Answered ]-Restoring OSQA database to initial state

1👍

Finally, this worked for me. Note that this is applicable only for OSQA using the bitnami environment with postgresql database.

if you want to restore your database state to the original version, first connect to postgres database using admin credentials(use any client, I used Dbeaver)

database : postgres
username : postgres
password : **admin password** : this is the same password you gave while installing bitnami-osqa

Now, drop the bitnami-osqa database and create it again(if you already have connections to bitnami_osqa, close them)

Drop-database bitnami_osqa;
Commit;

Create-database bitnami-osqa;
Commit;

Now open use_osqa.bat in your bitnami root folder and execute the following

cd apps\osqa
python manage.py syncdb --all --verbosity 2
[specify yes when it prompts to create super user and create some user]


python manage.py migrate forum --fake

1👍

You can use the django-admin.py flush:

Returns the database to the state it was in immediately after syncdb was executed. This means that all data will be removed from the database, any post-synchronization handlers will be re-executed, and the initial_data fixture will be re-installed.

django-admin.py flush

Leave a comment