Skip to content

Commit

Permalink
add test and deployment notes
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjiang committed Sep 27, 2023
1 parent 87d25bc commit 82a3441
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
38 changes: 38 additions & 0 deletions deploy_minter_migration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# run shoulder-check-minters command to check minters before running deployment
python manager.py shoulder-check-minters

# fix minter issues if needed

#
## update/deploy EZID code
# set DB user to eziddba

echo "shutdown EZID servies"
sudo cdlsysctl stop ezid
sudo cdlsysctl stop ezid-proc-*

echo "backup minter files"
timestamp=`date '+%Y%m%d%H%M%S'`
minters_bk="minters.${timestamp}"

cp -r ~/var/minters ~/var/${minters_bk}

echo "backed up minter files to ${minters_bk}"

echo "Generate a data migration files"
python manage.py makemigrations

echo "Apply the migration file to the database"
python manage.py migrate

echo "run minter data migration script"
python manage.py migrate-minters-to-mysql

echo "rename var/minters to disable BDB minter"
mv ~/var/minters ~/var/minters.sql_migration

echo "renamed to ~/var/minters.sql_migration"

echo "restart EZID services"
sudo cdlsysctl start ezid

40 changes: 40 additions & 0 deletions test_minter_migraiton.note
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# checkout latest BDB version
git checkout tags/3.1.8 -b v3.1.8-before-minter-migration

# make sure the /apps/ezid/var/minters directory and files are in place

# compare the outputs from BDB and mySQL version minters
# run the shoulder-check-minters command, to check the identifiers to be minted
# compare the outputs from BDB and mySQL version minters
python manage.py shoulder-check-minters > check-minters_bdb.out

# get the output in branch 87_Berkeley_DB_migration
git checkout 87_Berkeley_DB_migration

python manage.py shoulder-check-minters > check-minters_sql.out

# compare the outputs - the same minter should generate the same next ID
INFO shoulder-check-minters - doi:10.7941/D1 OK: Preview of next ID: doi:10.7941/D1Q33B


# test a minter can be extended
# create a test minter with default mask xxx with a initial capacity of xxx identifiers,
# create xxx+ 10 identifiers to verify the minter can be automatically extend itself

git checkout v3.1.8-before-minter-migration

python manage.py shoulder-create-ark ark:/12345/jj1 test-minter-jj1-for-migration

python manage.py shoulder-mint ark:/12345/jj1 -c 10000 > ark12345_jj1.ids.bdb

# delete shoulder etnry ark:/12345/jj1 from the shoulder table
# switch to the checkout 87_Berkeley_DB_migration branch

git checkout checkout 87_Berkeley_DB_migration

python manage.py shoulder-create-ark ark:/12345/jj1 test-minter-jj1-for-migration

python manage.py shoulder-mint ark:/12345/jj1 -c 10000 > ark12345_jj1_sql.ids



0 comments on commit 82a3441

Please sign in to comment.