Difference between revisions of "RucioUpdateToNewVersion"
From GridPP Wiki
								
												
				| Line 2: | Line 2: | ||
===Pre-steps===  | ===Pre-steps===  | ||
| + | |||
# Using the daily backup of DB02 move this to DB03 and apply the database  | # Using the daily backup of DB02 move this to DB03 and apply the database  | ||
| + | |||
## Find the latest backup  | ## Find the latest backup  | ||
  grep  Transferred  /var/log/atlasbackup/atlasbackup.log | tail -1  |   grep  Transferred  /var/log/atlasbackup/atlasbackup.log | tail -1  | ||
| + | |||
## Retrieve the backup  | ## Retrieve the backup  | ||
  [root@ruciodb02 ~]# tape -r csfserv <BackUpNumber> <location for backup>/tape.<BackUpNumber>  |   [root@ruciodb02 ~]# tape -r csfserv <BackUpNumber> <location for backup>/tape.<BackUpNumber>  | ||
| + | |||
## Move the backup to DB03 using SCP if backup not availale  | ## Move the backup to DB03 using SCP if backup not availale  | ||
  [root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> /mnt/backfs/ruciodb02_db_backup_202108241613 root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql  |   [root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> /mnt/backfs/ruciodb02_db_backup_202108241613 root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql  | ||
| + | |||
## Move the tape backup to DB03  | ## Move the tape backup to DB03  | ||
  [root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> <<location for backup>/tape.<BackUpNumber> root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql  |   [root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> <<location for backup>/tape.<BackUpNumber> root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql  | ||
| − | + | ||
| + | ## Unpack the tape backup  | ||
  [root@ruciodb03 ~]# tar xf tape.<BackUpNumber>  |   [root@ruciodb03 ~]# tar xf tape.<BackUpNumber>  | ||
| + | |||
| + | ## Find the database name on DB03  | ||
| + |  [root@ruciodb03 ~]# su postgres  | ||
| + |  bash-4.2$ psql  | ||
| + |  postgres-# \c   | ||
| + |  You are now connected to database "<DB_Name>" as user "postgres".  | ||
| + |  postgres-# \q  | ||
| + |  bash-4.2$  | ||
| + | |||
| + | ## Drop the current database  | ||
| + |  bash-4.2$ dropdb <DB_Name>  | ||
| + | |||
| + | ## Create a new databse and apply backup  | ||
| + |  bash-4.2$ createdb -T template0 <DB_Name>  | ||
| + |  psql  -v  -d <DB_Name> -f  <Path/To/Backup>/ruciodb02_<ID>   | ||
| + | This process will take some time (between 40-60 mins)  | ||
Revision as of 09:29, 25 August 2021
Instructions To Update Rucio
Pre-steps
- Using the daily backup of DB02 move this to DB03 and apply the database
 
- Find the latest backup
 
grep Transferred /var/log/atlasbackup/atlasbackup.log | tail -1
- Retrieve the backup
 
[root@ruciodb02 ~]# tape -r csfserv <BackUpNumber> <location for backup>/tape.<BackUpNumber>
- Move the backup to DB03 using SCP if backup not availale
 
[root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> /mnt/backfs/ruciodb02_db_backup_202108241613 root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql
- Move the tape backup to DB03
 
[root@ruciodb02 ~]# scp -i <Path/To/PrivateKey> <<location for backup>/tape.<BackUpNumber> root@ruciodb03.gridpp.rl.ac.uk:/var/lib/pgsql
- Unpack the tape backup
 
[root@ruciodb03 ~]# tar xf tape.<BackUpNumber>
- Find the database name on DB03
 
[root@ruciodb03 ~]# su postgres bash-4.2$ psql postgres-# \c You are now connected to database "<DB_Name>" as user "postgres". postgres-# \q bash-4.2$
- Drop the current database
 
bash-4.2$ dropdb <DB_Name>
- Create a new databse and apply backup
 
bash-4.2$ createdb -T template0 <DB_Name> psql -v -d <DB_Name> -f <Path/To/Backup>/ruciodb02_<ID>
This process will take some time (between 40-60 mins)