i have a poor man’s ‘continuous migration’ pipeline. it’s a bunch of shell scripts to do tasks like:
- pull phpbb db, attachments, etc from remote server
- create/manage discourse instances
- specific site_settings get applied when a discourse instance is created from a template instance
- back up/restore them
- run migration with a specific set of import scripts from a git repo
- do post-migration tasks
basically this allows me to work on a pre-migration discourse dctemplate
instance that i play around with. i continue to tweak discourse settings to my liking.
nightly, i pull from the live, existing phpbb and do a new migration on a new discourse instance (dcstaging
) just created from the newest template.
doing this takes hours, of course, so i also have a local phpbb running with a very small db that i use to do tests with and improve the migration scripts. i can do relatively fasts migrations to test on another discourse instance (dcdev
).
so daytime test workflow is like
did some work on the template, i like where i’m at:
./dc_template_create.sh dctemplate
oops, i made a mistake on my template. restore it to the previous state:
./dc_template_restore.sh dctemplate
do a quick migration to test some stuff out
# create a new instance dcdev from dctemplate (and apply specific site_settings to dcdev)
./dc_template_restore.sh dcdev dctemplate
./dc_migrate.sh dcdev # runs with migration script repo specific to that instance
do a long migration overnight from the real, live phpbb:
./dc_template_create.sh dctemplate
./dc_template_restore.sh dcstaging dctemplate
./phpbb_pull.sh
./dc_migrate.sh dcstaging
sleep 300
./dc_rake.sh dcstaging # extra post-migration tasks not handled by the importer for (create moderators, detailed tagging, moving some topics around, etc)
if anyone’s interested enough, i could clean it up a little and share it.