Migrate Treestatus data in Lando's Treestatus DB
Categories
(Conduit :: Lando, task)
Tracking
(Not tracked)
People
(Reporter: sheehan, Assigned: sheehan)
References
(Blocks 1 open bug)
Details
Once bug 1817472 and bug 1817473 are complete, we will need to perform a database migration of Treestatus' database into Lando's Treestatus tables.
Assignee | ||
Comment 1•1 year ago
|
||
I now have a working implementation of Treestatus in Lando that has been through a few rounds of reviews. We are getting close to being ready to deploy this to the Lando dev instance, where we want to host the existing Treestatus data and test the migration against some staging instance of downstream API consumers (Treeherder staging, etc).
As part of the migration we have changed the DB schema in a few ways, and I think the easiest way to move the data across is to scrape the data out of the existing Treestatus API and import it into the Lando DB with a script that handles the schema changes. I will need access to the Lando-dev DB to run the import script.
Once we are ready for the proper migration, we should be able to use the same script to import data into production Lando for the full migration.
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
After some discussion, it seems the best approach to get the data into the DB is to add a helper command to the lando-api
CLI that imports the data using the ORM. This approach will simplify both the script itself as we won't need to write any SQL, and avoid the need to set up a container with Postgres tools.
I'll add the new script to the Treestatus PR in Lando-API and deploy them to dev at the same time.
Assignee | ||
Comment 3•1 year ago
|
||
We ended up creating a command in Lando-API's CLI that queries the old Treestatus and pulls down all the historical data from the API, then creates ORM objects for each tree and log entry and adds them to the database. This command will be included in the Lando-API Treestatus PR, and has already been tested on Lando-API dev.
Description
•