Hi, I've set up a Meltano instance on a dev machin...
# best-practices
a
Hi, I've set up a Meltano instance on a dev machine and now want to move it to a live server so it cam be properly scheduled etc. I have the state stored in the default local SQLite database. I want to move everything so that I can keep the state and just get things running again on the new machine - I want to make sure that I don't need to re-extract the data, but continue to use the state in the database. 1. My approach will be to literally just copy all of the files in the Meltano folder over to the new machine and run it from there - are there any gotchas or considerations that I need to bear in mind for this approach? 2. Once in the new location, I would expect the new maintainer of this to sync it to a github repo - again, anything I should make them particularly aware of?
r
I feel like that should be OK as long as the Meltano versions match. You could instead export the state to files and later import (although a bit more cumbersome):
Copy code
# dev machine
meltano state list
meltano state get STATE_ID > STATE_ID.json

# live server
meltano state set --force STATE_ID "$(cat STATE_ID.json)"
anything I should make them particularly aware of?
No, it's pretty straight forward:
Copy code
git init -b main
git add .
git commit -m 'Initial commit'
git remote add origin <mailto:git@github.com|git@github.com>/ORG/REPO
git push --set-upstream origin main
Don't forget to remove sensitive credentials from your
meltano.yml
before pushing to GitHub! Meltano will direct sensitive config to
.env
with
meltano config <plugin> set <setting> <value>
which is ignored by Git, so this is only really something to look out for if you are manually editing the file.
👍 1
a
Great - thanks for the info, and in particular for the actual commands for managing the state 🙂
np 1