...
Documents the process for downloading a PROD daily backup to UAT and importing it.
Details
Step 1a (for regular PROD mapping clone): Do these steps on UAT. Retrieve the available backups. This currently requires logging in as the root user.
Code Block |
---|
> sudo su - root > sudo aws s3 ls s3://backup-ihtsdo-t1/daily/mapping.ihtsdotools.org/mapping/ |
...
Output will appear as a list of backups by date. The last six days of backups are retained, e.g.:
Code Block |
---|
root@uat-mapping:~# sudo aws s3 ls mapping.backup.ihtsdo 2014-09-28 01:02:47 343656836 dbbackup_mappingservicedb_201409280100.bak.gz 2014-09-29 01:02:48 343750530 dbbackup_mappingservicedb_201409290100.bak.gz 2014-09-30 01:02:49 343867437 dbbackup_mappingservicedb_201409300100.bak.gz 2014-10-01 01:02:46 343892129 dbbackup_mappingservicedb_201410010100.bak.gz 2014-10-02 01:02:46 349749641 dbbackup_mappingservicedb_201410020100.bak.gz 2014-10-03 01:04:15 349779484 dbbackup_mappingservicedb_201410030100.bak.gz |
...
Step 1b (for US-NLM PROD mapping clone): Do these steps on uat-us-mapping. Retrieve the available backups. This currently requires logging in as the root user.
...
Code Block |
---|
sudo aws s3 cp s3://backup-ihtsdo-t1/daily/mapping.ihtsdotools.org/mapping/mapping.ihtsdotools.org_2017-06-06T075349Z.zip /home/ihtsdo/data/doc/sqldump/backup.bak.zip cd /home/ihtsdo/data/doc/sqldump chown ihtsdo:ihtsdo backup.bak.zip # then as the "ihtsdo" extract solely the file that has the db clone in it: unzip -j backup.bak.zip mapping.ihtsdotools.org_2017-06-06T075349Z/mappingservicedb.sql -d /home/ihtsdo/data/doc/sqldump |
...
Step 3: Import the backup database contents (this may not be necessary or can be done another way)
...
Code Block |
---|
% mysql -uotf -p -h localhost -D mappingservicedb < mappingservicedb.sql |
...
Step 4: Reindex the contents of the database using the Lucene Reindex admin tool.
Notes: If you run out of space due to the ibdata1 file becoming too large, you can do this:
...
Code Block |
---|
supervisorctl stop mapping-service
--Delete mappingservicedb database (rather than just dropping the tables)
drop schema mappingservicedb;
--stop MySQL
service mysql stop
--Delete those three files
rm /var/lib/mysql/ibdata1
rm /var/lib/mysql/ib_logfile0
rm /var/lib/mysql/ib_logfile1
--Start MySQL
service mysql start
--Recreate table
\mysql ( to open mysql without alias)
CREATE DATABASE mappingservicedb
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT ALL ON mappingservicedb.* TO 'otf';
--Checking df to ensure storage usage did in fact go down a good idea
--And then load the dump file as normal. |
References/Links
- n/a
...