How to I can install old version discourse?

Hello!

For my needs I need version 2.0.4 (20180719103905)
How I can make fresh install Discourse v2.0.4?

If I install the current version, then I specify an app.yml version: 2.0.4, and run launcher rebuild app, then the process fails at the moment of migration.

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 14714 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
d5add83c70a88efc8dffa94a790092e6b7f3dc206dfeafc957c4c7699bd18db3
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one
1 Like

Why do you need that version?

No good can come from it, but you can stop discourse, delete the database directory, and then rebuild.

cd /var/discourse
./launcher stop app
rm -rf standalone/postgres_data/
./launcher rebuild app

Note: This will delete all of your data, but you say that you want a “fresh install”, so I guess that’s what you want. (This assumes that you’ve modified app.yml to install the version you want, which you seem to know how to do.)

2 Likes

Are you trying to downgrade? That’s not possible.

2 Likes

I also need to install an old version of discourse for supporting a mailman2discourse import script. When I modify the script I want to verify it runs ok against an existing discourse instance that has not been upgraded yet.

Is it possible ?

I recently imported a mailman list from the mbox file.

But you can delete the database and install a new instance of whatever version you want. Then you can backup and restore it to any newer version.

1 Like

Here is how it can be done:

  • Checkout a discourse_docker commit that is compatible with the old version (for instance git checkout 86b9032bbe75cfd11476c44a5c62f8882dd8ad97 is compatible with v2.5.4). There is no tagging so you have to guess.
  • Edit containers/app.yml and set version: v2.5.4
  • Run ./launcher rebuild app
2 Likes

The difficult part is importing the config.pck file holding the users, their preferences, the list owners and moderators etc. and figuring out how to map it to discourse.

1 Like

A recent change made it a little more complicated to get a tagged release. The updated instructions are:

  • Checkout a discourse_docker commit that is compatible with the old version (for instance git checkout 86b9032bbe75cfd11476c44a5c62f8882dd8ad97 is compatible with v2.5.4). There is no tagging so you have to guess.
  • Make sure the version parameter is not set in app.yml, for instance:
    params:
      db_default_text_search_config: "pg_catalog.english"
      #  version: stable
    
  • Add code to checkout the desired version towards the end of app.yml, for instance:
    hooks:
      after_code:
        - exec:
            cd: $home/plugins
            cmd:
              - git clone https://github.com/discourse/docker_manager.git
    +    - exec:
    +        cd: $home
    +        cmd:
    +          - git fetch --depth=1 origin tag v2.5.4 --no-tags
    +          - git checkout v2.5.4
    
  • Run ./launcher rebuild app
3 Likes