Reputation: 2363
I've been trying to migrate data from Trac 0.11 to Redmine 3.1.1 which both are on the same machine, Windows Server 2012. I installed redmine 3.1.1 with Bitnami, and followed this migration guide: http://www.redmine.org/projects/redmine/wiki/RedmineMigrate , except sqlite3-ruby because when I installed sqlite3-ruby gem it said that it renamed to sqlite3 so use it instead. I then installed sqlite3 gem as the following command.
gem install --local C:\Users\Administrator\Downloads\sqlite3-1.3.11.gem -- --with-sqlite3-include=D:\Bitnami\redmine-3.1.1-1\sqlite --with-sqlite3-lib=D:\Bitnami\redmine-3.1.1-1\sqlite --with-sqlite3-dir=D:\Bitnami\redmine-3.1.1-1\sqlite
The server has a firewall so I downloaded sqlite3 gem and installed it from the local folder.
gem list shows the following,
*** LOCAL GEMS ***
bigdecimal (1.2.0)
bundler (1.9.6)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
sqlite3 (1.3.11)
sqlite3-ruby (1.3.3)
test-unit (2.0.0.0)
Before executing the rake command, I had to fix the migrate_from_trac.rake as this post suggested: http://www.redmine.org/issues/19173 By the way, the file is located at D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs\lib\tasks\migrate_from_trac.rake
Then I ran the following command at D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs,
bundle exec rake redmine:migrate_from_trac RAILS_ENV="production" --trace
DL is deprecated, please use Fiddle
** Invoke redmine:migrate_from_trac (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:migrate_from_trac
WARNING: a new project will be added to Redmine during this process.
Are you sure you want to continue ? [y/N] y
Trac directory []: D:\TracLight\projects\trac\all
Trac database adapter (sqlite3, mysql2, postgresql) [sqlite3]:
Trac database encoding [UTF-8]:
Target project identifier []: all
This project already exists in your Redmine database.
Are you sure you want to append data to this project ? [Y/n] y
rake aborted!
Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:50:in `establish_connection'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/lib/tasks/migrate_from_trac.rake:712:in `block in establish_connection'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/lib/tasks/migrate_from_trac.rake:709:in `each'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/lib/tasks/migrate_from_trac.rake:709:in `establish_connection'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/lib/tasks/migrate_from_trac.rake:374:in `migrate'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/lib/tasks/migrate_from_trac.rake:770:in `block (2 levels) in <top (required)>'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
D:/Bitnami/redmine-3.1.1-1/ruby/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
D:/Bitnami/redmine-3.1.1-1/apps/redmine/htdocs/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => redmine:migrate_from_trac
So, I added the following line to the Gemfile which is located at D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs
gem 'sqlite3', '1.3.11'
But it didn't change anything, the above command still gives me the same error. I also tried several bundle commands as the following,
bundle install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.
You have added to the Gemfile:
* sqlite3 (= 1.3.11)
However, I can't find any line about sqlite3 on Gemfile.lock. I thought it might be Gemfile.lock file's problem so I then deleted Gemfile.lock and executed bundle install command as the following to recreate it, but it didn't generate Gemfile.lock.
build install
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.
You have added to the Gemfile:
* source: rubygems repository https://rubygems.org/
* thin (= 1.6.1)
* eventmachine (= 1.0.3)
* rmagick (= 2.13.4)
* mysql2 (= 0.3.18)
* sqlite3 (= 1.3.11)
* rails (= 4.2.4)
* jquery-rails (~> 3.1.3)
* coderay (~> 1.1.0)
* builder (>= 3.0.4)
* request_store (= 1.0.5)
* mime-types
* protected_attributes
* actionpack-action_caching
* actionpack-xml_parser
* loofah (~> 2.0)
* tzinfo-data
* rbpdf (~> 1.18.6)
* net-ldap (~> 0.3.1)
* ruby-openid (~> 2.3.0)
* rack-openid
* redcarpet (~> 3.3.2)
* activerecord-jdbc-adapter (~> 1.3.2)
* activerecord-jdbcmysql-adapter
* rdoc (>= 2.4.2)
* yard
* minitest
* rails-dom-testing
* mocha
* simplecov (~> 0.9.1)
* capybara
* selenium-webdriver
EDIT
I forgot to mention that all the things were done on Bitnami Redmine Stack Environment by clicking use_redmine.bat at D:\Bitnami\redmine-3.1.1-1.
Upvotes: 0
Views: 334
Reputation: 2363
I had to install sqlite3 gem to under the D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs\vendor\bundle\ruby\2.0.0\gems for bundler. To do so, I ran the following command.
bundle exec gem install --local C:\Users\Administrator\Downloads\sqlite3-1.3.11.gem -- --with-sqlite3-include=D:\Bitnami\redmine-3.1.1-1\sqlite --with-sqlite3-lib=D:\Bitnami\redmine-3.1.1-1\sqlite --with-sqlite3-dir=D:\Bitnami\redmine-3.1.1-1\sqlite
Then, I could see that the sqlite3 folder at D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs\vendor\bundle\ruby\2.0.0\gems\sqlite3-1.3.11
After that, I needed to add the line "sqlite3 (1.3.11)" at the end of GEM section of Gemfile.lock at D:\Bitnami\redmine-3.1.1-1\apps\redmine\htdocs. Then "bundle show" starts showing me "sqlite3 (1.3.11)" on the list.
Although I could successfully run the migrate_from_trac task, other error happens during migrating wiki. But that's another story.
Upvotes: 1