Restoring a JIRA Database post disaster

It is always advisable to backup the JIRA DB using native DB backup strategy rather than using JIRA’s XML based backups. I used Postgres DB on the backend and took complete DB Backups. In case of disaster – build up a new server, install JIRA and restore the DB and you’ll be good to go in just an hour.

Here are the steps I followed to restore a Postgres DB on JIRA:

  1. Create a blank database “jiradb” on the target machine (eagle-backup). In case an older database already exists on the server – drop the database and create a new one such that no table definitions exist on the database
  2. Create database user ‘jira’ on the jiradb with same password on the primary instance (**********) and grant all access to this database
    	su postgres
    	psql
    	DROP DATABASE jiradb
    	CREATE USER jira WITH PASSWORD '***********'
    	CREATE DATABASE jiradb
    	GRANT ALL PRIVILEGES ON DATABASE jiradb TO jira
    	\q
  3. Execute the backup script file on the jiradb (Target server) using
            su postgres
            pgsql jiradb < jiradb_backup......sql
            
  4. Restart JIRA/Postgres services

And that’s it. You are ready with a running JIRA from a point when the last DB Backup was taken.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s