HOW TO MAKE A BACKUP
*Before you start, make sure you know your database password (oasispg).*
- Select your database
Open pgAdmin and expand the "Servers" tree on the left. Find your database named "OASIS", right-click its name, and select "Backup..."
- Name your backup file
In the "General" tab, click the "..." button next to the "Filename" box. Choose a folder where you want to save it, type a name for your file (like "OASIS_backup.sql"), and click "Save".
- Choose the format
In that same window, change the "Format" dropdown to "Custom". (This is important because it makes restoring much easier later).
- Set the roll name
In that same window, change the "Role name" dropdown to "OASIS".
- Run the backup
Click the "Backup" button at the bottom right. A little pop-up will appear in the bottom corner telling you when the backup is successfully completed.
HOW TO RESTORE A BACKUP
*To avoid data conflicts, you always want to restore into a fresh, empty target database.*
PART A: CREATE THE "OASIS" USER WITH FULL PRIVILEGES
- Open the Login window
In the left-hand tree, expand your server. Right-click on the words "Login/Group Roles" and select "Create > Login/Group Role..."
- Name the user
In the "General" tab, type the name "OASIS" in the "Name" box.
- Set the password
Switch to the "Definition" tab. Type "oasispg" into the "Password" box.
- Grant Superuser/Full privileges
Switch to the "Privileges" tab. Turn on the following switches to give full power:
* Set "Can login?" to YES
* Set "Superuser" to YES (This automatically grants full privileges across the database)
- Save the user
Click the "Save" button at the bottom right.
PART B: CREATE THE TARGET DATABASE
- Open the creation window
In the left-hand tree, right-click on the word "Databases" and select "Create > Database..."
- Name and assign the database
In the "General" tab, type "OASIS" in the "Database" box.
Change the "Owner" dropdown menu to your newly created user: "OASIS".
- Save and create
Click the "Save" button at the bottom right. You will see your brand-new, empty "OASIS" database appear in the list on the left.
PART C: RUN THE RESTORE
- Open the Restore tool
Right-click your newly created "OASIS" database and select "Restore..."
- Select your backup file
In the "General" tab, change the "Format" dropdown to "Custom or tar". Then, click the "..." button next to "Filename", locate the backup file ("OASIS_backup.sql"), and select it.
- Run the restore
Click the "Restore" button at the bottom right. pgAdmin will process the file using your backup data and alert you in the bottom right corner when the process has started and is complete.
Comments
0 commentsPlease sign in to leave a comment.