I had to upgrade our BitNami Redmine stack from 0.8.3 to 0.9.4. It should have been very simple, according to the official howto, May 15 update. It ended up requiring a day and a half due to a combination of factors, one being that I also had to clone the virtual machine it was on to another host, another being that I couldn’t remember the MySQL database password so had to find a way to reset it, yet MySQL gave confusing error message, and yet another being that the gap between 0.8.3 and 0.9.4 is quite large so extra steps were necessary.
I followed the steps mentioned on mostly two sites, but with tweaks:
- http://bitnami.org/forums/forums/redmine/topics/fresh-install-of-rs-redmine-how-to-bring-old-db-across
- http://bitnami.org/article/how-to-backup-and-update-the-bitnami-redmine-stack, May 15 update
Several other sites used during process but the clean set of steps follows:
- Backup Redmine database:
- verify that
<bitnami>\mysql\my.ini
has correct user/password/port in[mysqladmin]
group and that, if using non-standard port, it is set in the[mysqldump]
group with a port=# setting - open console
- verify that
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. cmd> cd "\Program Files\BitNami Redmine Stack" cmd> scripts\setenv.bat cmd> mysqladmin --version mysqladmin Ver 8.41 Distrib 5.0.51b, for Win32 on ia32 cmd> mysqldump -u root -p bitnami_redmine > redmine_backup.sql Enter password: **** cmd> dir redmine_backup.sql Volume in drive C has no label. Volume Serial Number is 4817-9C88 Directory of C:\Program Files\BitNami Redmine Stack 05/25/2010 04:04 PM 8,491,541 redmine_backup.sql 1 File(s) 8,491,541 bytes 0 Dir(s) 2,283,737,088 bytes free cmd>
- Stop and uninstall previous Bitnami Redmine Stack services (can do from Start menu)
- Install new Bitnami Redmine stack in NEW location, I chose “C:\Program Files\Bitnami Redmine Stack 094”
- Download the new Redmine Stack for your platform.
- Remember username/password, will be used when restoring database
- Do not enter email address otherwise may get “Email has already been taken” if attempt to change account settings of a Redmine user that has same email address!
- Setup email settings now or later; old settings are in
<old_bitnami>/apps/redmine/config/email.yml
- Allow redmine to start
- Confirm Redmine works (visit http://localhost/redmine)
- Stop new stack; this seems optional but also seems like a good thing to do!
- Open a NEW console for the NEW redmine
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. cmd> cd "\Program Files\BitNami Redmine Stack 094" cmd> scripts\setenv.bat
- Create proper database schema to receive old database
cmd> mysql -u root -p Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 10 Server version: 5.0.83-community-log MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show grants; +---------------------------------------------------------------------------------------------------------------+ | Grants for root@localhost | +---------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '426f44267cd6981a' WITH GRANT OPTION | +---------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> drop database bitnami_redmine; Query OK, 47 rows affected (0.28 sec) mysql> create database bitnami_redmine; Query OK, 1 row affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON bitnami_redmine.* TO 'root'@'localhost' IDENTIFIE D BY PASSWORD '216f42268cd5911a'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> exit; Bye
- Restore old Database into new:
cmd> mysql -u root -p bitnami_redmine < "\Program Files\BitNami Redmine Stack\redmine_backup.sql" cmd>
- Merge settings from old (C:\Program Files\BitNami Redmine Stack\apps\redmine\config) into new (C:\Program Files\BitNami Redmine Stack 094\apps\redmine\config). This involves three files:
settings.yml
: I found that no lines had changed; only new lines added so left the new version untouched.database.yml
: left the new version untouched; note: the username is bitnami, rather than the one you selected at installation time; the password is randomly generated by installation tool, it is not a hash.email.yml
: if you didn’t setup at installation time, copy file from old stack.
- If you installed additional redmine plugins, you should copy them to the new location. This step is still not clear to me as I didn’t have installed plugins but a whole slew of them are included with the system. I didn’t do anything in this step but the official guide says: You can get the full list of installed plugins in Administration -> Plugins section. The folder is <bitnami>/apps/redmine/vendor/plugins.
- Migrate the data imported to the new schema:
cmd> cd apps\redmine cmd> rake db:migrate RAILS_ENV=production ..... ..... cmd> rake db:migrate:upgrade_plugin_migrations RAILS_ENV=production (in C:/Program Files/BitNami Redmine Stack 094/apps/redmine) Fixing migration info Migration info successfully migrated - removing old schema info table cmd> rake db:migrate_plugins RAILS_ENV=production (in C:/Program Files/BitNami Redmine Stack 094/apps/redmine) Migrating engines... Migrating acts_as_activity_provider... ... Migrating ruby-net-ldap-0.0.4...
- Clear caches:
cmd> rake tmp:cache:clear (in C:/Program Files/BitNami Redmine Stack 094/apps/redmine) cmd> rake tmp:sessions:clear (in C:/Program Files/BitNami Redmine Stack 094/apps/redmine)
- Copy everything in <old_bitnami>/apps/redmine/files to <new_bitnami/apps/redmine/files
- Start new stack
- Verify that data looks ok: issues, wiki, attachments, projects hierarchy, users
Enjoy your new redmine!
June 30, 2011 at 8:14 am
Hi – probably a stupid thing to ask but what is the password used in the statement BY PASSWORD ‘216f42268cd5911a’; i.e. how do you access msql (root) with this change for the new database?
thansk, from a redmine newbie.
June 30, 2011 at 11:47 am
It’s been a while! Have you checked the \mysql\my.ini?
January 19, 2012 at 8:23 am
In case it helps, the ‘216f42268cd5911a’ should match the String after ‘INDENTIFIED BY PASSWORD’ when the command ‘show grants’ is run in the previous step.
April 28, 2012 at 12:41 pm
Thanks for posting that detail, I’d forgotten!
January 19, 2012 at 8:21 am
Thanks very much for this – saved me a lot of effort.
January 22, 2013 at 6:39 am
[…] https://schollii2.wordpress.com/2010/05/26/upgrading-a-bitnami-redmine-stack-on-windows/ […]