Restore the PostgreSQL Database
-
To restore the database, you need a complete working Torrent Server installation.
The two scenarios for restoring a database are:
-
To restore the database from the backup file, execute these commands on the Torrent Server:
{{# copy the backup file to the server and decompress it gzip -d iondb.20100711_142442.backup.gz # stop the Torrent Server background processes sudo /etc/init.d/ionCrawler stop sudo /etc/init.d/ionJobServer stop sudo /etc/init.d/ionPlugin stop sudo /etc/init.d/celeryd stop # login as user postgres sudo su postgres # restart the service to clear database connections /etc/init.d/postgresql restart # drop the existing iondb database dropdb iondb # create a new empty database psql <<-EOFdb CREATE DATABASE iondb; GRANT ALL PRIVILEGES ON DATABASE iondb to ion; \q EOFdb # import data psql -e iondb < iondb.20100711_142442.backup # logout of user postgres exit # start the Torrent Server background processes sudo /etc/init.d/ionCrawler start sudo /etc/init.d/ionJobServer start sudo /etc/init.d/ionPlugin start sudo /etc/init.d/celeryd start}}
Occasionally, there is a django error after completing the import data step.
If an error is displayed on the browser UI, repeat the following steps: