Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to upgrade from sameersbn/redmine: 4.1.1-8 to sameersbn/redmine: 5.1.1-1 ? #535

Closed
wangyu8460958 opened this issue Jan 12, 2024 · 5 comments

Comments

@wangyu8460958
Copy link

I deployed redmine 4.1 using this docker-compose.yml file, part of docker-compose.yml is shown below:

version: '2'

services:
  postgresql:
    restart: always
    image: sameersbn/postgresql:9.6-2
    environment:
    - DB_USER=redmine
    - DB_PASS=redmine
    - DB_NAME=redmine
    volumes:
    - /mnt/data/redmine/postgresql:/var/lib/postgresql

  memcached:
    restart: always
    image: sameersbn/memcached:latest

  redmine:
    restart: always
    image: sameersbn/redmine:4.1.1-8
#    image: sameersbn/redmine:2.6.10-8
    depends_on:
    - postgresql
    - memcached

Then I want to update to redmine 5.1 , I use this docker-compose.yml file: https://github.com/sameersbn/docker-redmine/blob/master/docker-compose-memcached.yml

I exported postgresql 9 to a sql file and imported it to postgresql 14, and the import reported an error:

9I_P2138}G$LLC)193HKR99

My question is :

  1. I want to upgrade from sameersbn/redmine:4.1.1-8 to sameersbn/redmine:5.1.1-1, is it possible? If it can be achieved, what are the steps?
  2. Use https://github.com/sameersbn/docker-redmine/blob/master/docker-compose-memcached.yml to start redmine:5.1.1, the postgresql image can be changed to sameersbn/ postgresql:9.6-2 ?
  3. What is the default username and password for the redmine login screen after using https://github.com/sameersbn/docker-redmine/blob/master/docker-compose-memcached.yml to start redmine:5.1.1?
@jcormier
Copy link
Collaborator

jcormier commented Jan 12, 2024

  1. I want to upgrade from sameersbn/redmine:4.1.1-8 to sameersbn/redmine:5.1.1-1, is it possible? If it can be achieved, what are the steps?
  • Copy everything from your current redmine to a 2nd "testing" instance
  • Make sure testing instance works
  • Bring down the container
  • Update version tag in 2nd copy
  • Bring up container
  • Test and make sure everything goes well before trying on your production instance
    In my experience plugins are the hardest part of doing an upgrade, you need to go through each of your plugins and make sure they are still working, and if not go and hopefully find an updated version.
  1. Use https://github.com/sameersbn/docker-redmine/blob/master/docker-compose-memcached.yml to start redmine:5.1.1, the postgresql image can be changed to sameersbn/postgresql:9.6-2 ?

According to redmine you can use postgresql for 5.1 with versions > 9.2, so keeping your postgresql version at 9.6 is okay. However, you will need version 14, possibly by the next release (whatever version there trunk gets released as)
https://www.redmine.org/projects/redmine/wiki/RedmineInstall

postgresql has a guide on how to upgrade server versions here: https://www.postgresql.org/docs/14/upgrading.html
Note they recommend doing the sql dump using the tools from the newer version.

To make the backup, you can use the pg_dumpall command from the version you are currently running; see Section 26.1.2 for more details. For best results, however, try to use the pg_dumpall command from PostgreSQL 14.10, since this version contains bug fixes and improvements over older versions. While this advice might seem idiosyncratic since you haven't installed the new version yet, it is advisable to follow it if you plan to install the new version in parallel with the old version. In that case you can complete the installation normally and transfer the data later. This will also decrease the downtime.

  1. What is the default username and password for the redmine login screen after using https://github.com/sameersbn/docker-redmine/blob/master/docker-compose-memcached.yml to start redmine:5.1.1?

This is redmine specific. https://www.redmine.org/projects/redmine/wiki/RedmineInstall#Step-10-Logging-into-the-application

@jcormier
Copy link
Collaborator

https://github.com/sameersbn/docker-postgresql#upgrading

I just looked into sameersbn's postgresql image and it looks like it can do its own migration. I think it uses the pg_upgrade module.

Note: I'd do these upgrades seperately. Upgrade your postgresql and leave the redmine version alone. And when thats working you can work on the redmine upgrade...

  • Make backups
  • Bring down container
  • Change postgresql version tag
  • Bring up container
$ docker-compose up
Creating network "docker-redmine_default" with the default driver
Creating docker-redmine_postgresql_1 ... done
Creating docker-redmine_redmine_1      ... done
Attaching to docker-redmine_postgresql_1, docker-redmine_redmine_1, docker-redmine_postgresql14_1
postgresql_1    | Initializing datadir...
postgresql_1    | Initializing certdir...
postgresql_1    | Initializing logdir...
postgresql_1    | Initializing rundir...
redmine_1       | Initializing logdir...
postgresql_1    | Setting resolv.conf ACLs...
postgresql_1    | Initializing database...
postgresql_1    | ‣ Migrating PostgreSQL 9.6 data to 14...
postgresql_1    | ‣ Installing PostgreSQL 9.6...
redmine_1       | Initializing datadir...
redmine_1       | Symlinking dotfiles...
redmine_1       | Installing configuration templates...
redmine_1       | Configuring redmine...
postgresql_1    | W: http://apt.postgresql.org/pub/repos/apt/dists/jammy-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
postgresql_1    | debconf: delaying package configuration, since apt-utils is not installed
postgresql_1    | ‣ Migration in progress. Please be patient...Performing Consistency Checks
postgresql_1    | -----------------------------
postgresql_1    | Checking cluster versions                                   ok
postgresql_1    | Checking database user is the install user                  ok
postgresql_1    | Checking database connection settings                       ok
postgresql_1    | Checking for prepared transactions                          ok
postgresql_1    | Checking for system-defined composite types in user tables  ok
postgresql_1    | Checking for reg* data types in user tables                 ok
postgresql_1    | Checking for contrib/isn with bigint-passing mismatch       ok
postgresql_1    | Checking for user-defined encoding conversions              ok
postgresql_1    | Checking for user-defined postfix operators                 ok
postgresql_1    | Checking for incompatible polymorphic functions             ok
postgresql_1    | Checking for tables WITH OIDS                               ok
postgresql_1    | Checking for invalid "sql_identifier" user columns          ok
postgresql_1    | Checking for invalid "unknown" user columns                 ok
postgresql_1    | Creating dump of global objects                             ok
postgresql_1    | Creating dump of database schemas
postgresql_1    |   postgres
postgresql_1    |   redmine_production
postgresql_1    |   template1
postgresql_1    |                                                             ok
postgresql_1    | Checking for presence of required libraries                 ok
postgresql_1    | Checking database user is the install user                  ok
postgresql_1    | Checking for prepared transactions                          ok
postgresql_1    | Checking for new cluster tablespace directories             ok
postgresql_1    | 
postgresql_1    | If pg_upgrade fails after this point, you must re-initdb the
postgresql_1    | new cluster before continuing.
postgresql_1    | 
postgresql_1    | Performing Upgrade
postgresql_1    | ------------------
postgresql_1    | Analyzing all rows in the new cluster                       ok
postgresql_1    | Freezing all rows in the new cluster                        ok
postgresql_1    | Deleting files from new pg_xact                             ok
postgresql_1    | Copying old pg_clog to new server                           ok
postgresql_1    | Setting oldest XID for new cluster                          ok
postgresql_1    | Setting next transaction ID and epoch for new cluster       ok
postgresql_1    | Deleting files from new pg_multixact/offsets                ok
postgresql_1    | Copying old pg_multixact/offsets to new server              ok
postgresql_1    | Deleting files from new pg_multixact/members                ok
postgresql_1    | Copying old pg_multixact/members to new server              ok
postgresql_1    | Setting next multixact ID and offset for new cluster        ok
postgresql_1    | Resetting WAL archives                                      ok
postgresql_1    | Setting frozenxid and minmxid counters in new cluster       ok
postgresql_1    | Restoring global objects in the new cluster                 ok
postgresql_1    | Restoring database schemas in the new cluster
postgresql_1    |   template1
postgresql_1    |   postgres
postgresql_1    |   redmine_production
postgresql_1    |                                                             ok
postgresql_1    | Copying user relation files
postgresql_1    |   /var/lib/postgresql/9.6/main/base/12405/2613
...
postgresql_1    |   /var/lib/postgresql/9.6/main/base/1/2683
postgresql_1    |                                                             ok
postgresql_1    | Setting next OID for new cluster                            ok
postgresql_1    | Sync data directory to disk                                 ok
postgresql_1    | Creating script to delete old cluster                       ok
postgresql_1    | Checking for hash indexes                                   ok
postgresql_1    | Checking for extension updates                              ok
postgresql_1    | 
postgresql_1    | Upgrade Complete
postgresql_1    | ----------------
postgresql_1    | Optimizer statistics are not transferred by pg_upgrade.
postgresql_1    | Once you start the new server, consider running:
postgresql_1    |     /usr/lib/postgresql/14/bin/vacuumdb --all --analyze-in-stages
postgresql_1    | 
postgresql_1    | Running this script will delete the old cluster's data files:
postgresql_1    |     ./delete_old_cluster.sh
postgresql_1    | 
postgresql_1    | Configuring hot standby...
postgresql_1    | ‣ Setting postgresql.conf parameter: wal_level = 'hot_standby'
postgresql_1    | ‣ Setting postgresql.conf parameter: max_wal_senders = '16'
postgresql_1    | ‣ Setting postgresql.conf parameter: checkpoint_segments = '8'
postgresql_1    | ‣ Setting postgresql.conf parameter: wal_keep_segments = '32'
postgresql_1    | ‣ Setting postgresql.conf parameter: hot_standby = 'on'
postgresql_1    | ‣ Setting postgresql.conf parameter: data_directory = '/var/lib/postgresql/14/main'
postgresql_1    | ‣ Setting postgresql.conf parameter: log_directory = '/var/log/postgresql'
postgresql_1    | ‣ Setting postgresql.conf parameter: log_filename = 'postgresql-14-main.log'
postgresql_1    | Trusting connections from the local network...
postgresql_1    | ‣ Setting postgresql.conf parameter: ssl = 'off'
postgresql_1    | Creating database user: redmine
postgresql_1    | Creating database: redmine_production...
postgresql_1    | ‣ Granting access to redmine user...
postgresql_1    | Starting PostgreSQL 14...
postgresql_1    | 2024-01-12 22:11:55.971 UTC [1] LOG:  starting PostgreSQL 14.8 (Ubuntu 14.8-1.pgdg22.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, 64-bit
postgresql_1    | 2024-01-12 22:11:55.971 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgresql_1    | 2024-01-12 22:11:55.971 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgresql_1    | 2024-01-12 22:11:55.983 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgresql_1    | 2024-01-12 22:11:55.990 UTC [3265] LOG:  database system was shut down at 2024-01-12 22:11:55 UTC
postgresql_1    | 2024-01-12 22:11:55.996 UTC [1] LOG:  database system is ready to accept connections
redmine_1       | Configuring redmine::database.....................
redmine_1       | Configuring redmine::unicorn...
redmine_1       | Configuring redmine::secret_token...
redmine_1       | Generating a session token...
redmine_1       | Note:
redmine_1       |   All old sessions will become invalid.
redmine_1       |   Please specify the REDMINE_SECRET_TOKEN parameter for persistence.
redmine_1       |   **SHOULD** be defined if you have a load-balancing Redmine cluster.
redmine_1       | Configuring redmine::max_concurrent_ajax_uploads...
redmine_1       | Configuring redmine::sudo_mode...
redmine_1       | Configuring redmine::autologin_cookie...
redmine_1       | Configuring redmine::backups...
redmine_1       | Configuring redmine::rmagic::font...
redmine_1       | Configuring nginx...
redmine_1       | Configuring nginx::redmine...
redmine_1       | Installing plugins...
redmine_1       | Installing themes...
redmine_1       | 2024-01-13 03:41:57,749 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
redmine_1       | 2024-01-13 03:41:57,749 INFO Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
redmine_1       | 2024-01-13 03:41:57,749 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing
redmine_1       | 2024-01-13 03:41:57,749 INFO Included extra file "/etc/supervisor/conf.d/unicorn.conf" during parsing
redmine_1       | 2024-01-13 03:41:57,751 INFO RPC interface 'supervisor' initialized
redmine_1       | 2024-01-13 03:41:57,751 INFO supervisord started with pid 1
redmine_1       | 2024-01-13 03:41:58,753 INFO spawned: 'unicorn' with pid 334
redmine_1       | 2024-01-13 03:41:58,755 INFO spawned: 'cron' with pid 335
redmine_1       | 2024-01-13 03:41:58,756 INFO spawned: 'nginx' with pid 336
redmine_1       | 2024-01-13 03:42:00,053 INFO success: unicorn entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
redmine_1       | 2024-01-13 03:42:00,054 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
redmine_1       | 2024-01-13 03:42:00,054 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

@wangyu8460958
Copy link
Author

@jcormier , you said : Update version tag in 2nd copy , what do I need to change in which files for which content?

@jcormier
Copy link
Collaborator

In your docker-compose file, change sameersbn/redmine:4.1.1-8 to whatever version you are trying to go to.

@jcormier
Copy link
Collaborator

Closing due to no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants