Where to keep custom importer source?

I suggest working with two containers. You can do so by creating a copy of your current app.yml file (you can find it in /var/discourse/containers) and renaming it to something else like import.yml. Then update the version parameter to your custom importer branch.

params:
  version: your-branch

Anytime you need to run the import, stop the app container, start the import container and run the script inside the import container. If significant changes were made in Discourse, you may need to rebase your branch with the latest commit from core, and rebuild the container.

cd /var/discourse
./launcher enter import

# want to switch to a different branch?
su discourse -c 'git checkout <branch>'

# want to pull new code?
su discourse -c 'git pull'

Once you are done with the migration, stop the import container and restart the app one.

cd /var/discourse
./launcher stop import
./launcher start app

Credits to @gerhard who taught me how to do all this :backhand_index_pointing_up:

6 Likes