UCDavisLibrary / ucdlib-travel

Travel Request Application for the UC Davis Library
0 stars 0 forks source link

Migration script #82

Open spelkey-ucd opened 3 months ago

spelkey-ucd commented 3 months ago

We need to be able to move the current year's travel requests into the new system.

Basic steps should be as follows:

  1. Download sqldump of existing travel database
  2. Place dump in travel GC bucket
  3. Add dump file to gitignore
  4. Create a commented out line in /deploy/templates/local-dev.yaml forwarding port for db: ports: - 5432:5432
  5. Create new directory called migration at root of project for all your code.
  6. Create a simple dockerfile with node and postgres+mysql clients
  7. Create docker compose file that will have your node image and standard mysql image.
  8. mysql image should automatically load your sqldump file
  9. node image should have a bind mount with all your migration code
  10. forward postgres port from main docker compose stack to node container in migration stack
  11. Then to run migration script, should bash into container, and migrate a single request or all for a year. e.g. node ./run.js --single=2340 or node ./run.js --year=22024
  12. Make sure you have a good readme for running the migration

Let me know if you have questions.

spelkey-ucd commented 6 days ago

@sbagg I merged the pr for this issue, but am unable to find the old data in google cloud, re step 2. Please upload, so I can run the code.

sbagg commented 6 days ago

I uploaded zip file of the old data to bucket in prod folder