Useful server commands
Here is a list of commands for Easy Redmine server admins to use in common back-end adminstration of the application. Although it is not possible to provide a full and detailed guide for all Linux distributions and configurations, we hope these will provide guidance to a reasonable extent.
Feedback from experience with your environment and configuration is welcome. So if you think you have some tips for fellow admins, let us know on support. After verification (and your consent), we may post it here.
Situation | Command | Result | Notes |
Application didn't start |
|
|
Firstly, verify which servers you use :) |
Migrations are missing (may result in internal errors) | bundle exec rake db:migrate redmine:plugins:migrate RAILS_ENV=production | migrates redmine and redmine plugins | Concerns plugins located in directory /plugins |
Migrations are missing (may result in internal errors) | bundle exec rake easyproject:install RAILS_ENV=production | installs Easy Redmine | Run it after DB migrations; or update installation, if installing manually (restart server afterwards) |
Want to uninstall an easy plugin | bundle exec rake easyproject:uninstall:all_plugins RAILS_ENV=production | uninstalls/unmigrates easy plugins (with prompt) | For plugins in directory /plugins/easyproject/easy_plugins Details here |
Want to uninstall a redmine plugin | bundle exec rake redmine:plugins:migrate NAME=easy_gantt VERSION=0 | uninstalls/unimgrates plugins | For plugins in directory /plugins |
Issues with dependencies | bundle update | updates gems | |
Restart physical server | reboot | restarts physical server | |
Can't connect to the database | systemctl restart mysql / systemctl restart postgresql | restarts database server | |
Production log monitoring | tail -f [redmine root]/log/production.log | realtime monitoring of the application log | Useful when you want to trace an internal error, or other disfunctionality |
Rails console |
rails c |
run the rails console | for ruby commands, check that the app can start |
Insufficient permissions on server (general) | sudo chown -R [linux user]:[linux group] [redmine root] | sets correct groups and ownerships | You need to add correct user and folder of Easy Redmine |
Insufficient permissions on server (in our VM) | chown easy:easy -R $(eval echo "~easy") | sets correct groups and ownerships | In VMs created by Easy Software |
Insufficient permission on server | sudo chmod -R 775 [redmine‘s root] | adds correct permissions | Other levels here |
bulk updates (rails example) |
rails c production |
run a custom sql query (rails console) | On your own risk! Be careful with custom queries, you may be performing changes prohibitted or incompatible in the GUI of the application. May result in disfunction of the application with dire consequences. |
bulk updates (mysql example) |
mysql -u user -p password -h host |
|
|
Working with backups |
|
|
For MySQL |
Project tree is broken | rails c production Project.rebuild_tree! exit |
recalculates the project tree – correct parent and subprojects |
|
Tree recalculation of other entities (examples) | Issue.rebuild_tree!; IssueCategory.rebuild_tree!; EasyKnowledgeCategory.rebuild_tree! | recalculates tree of other entities | |
Configuration file DB (general) | cat [redmine root]/config/database.yml | db config | |
Configuration file email (general) | cat [redmine root]/config/configuration.yml | email config | |
Verify/edit CRON (automatic server tasks) | crontab -e | edit crontab | More info here |
Resource managment is missing data | bundle exec rake easy_gantt_resources:reallocate_resources RAILS_ENV=production | recalculates hour allocations | May be needed after DB migrations, installation of Resource management |
Information | top | process list, system info | |
Out of disk space | df | shows free space on devices | |
Easy DMS cache is obsolete | ruby [redmine root]/plugins/redmine_dmsf/extra/xapian_indexer.rb | only for redmine_dmsf users, should be run by cron | |
Switched text editing from textile to HTML | bundle exec rake easyproject:textile:migrate_all RAILS_ENV=production | Texts are migrated from textile to HTML formatting | |
Activated new currency in administration, but it is not visible in projects | bundle exec rake easyproject:currency_update_tables RAILS_ENV=production |
Afterwards restart server |
|
After activation of currency, I need to recalculate all existing entries | bundle exec rake easyproject:currency_recalculate_all RAILS_ENV=production | Existing entries are recalculated into the new cerrency | |
Manual recalculation of personnel costs | bundle exec rake easyproject:easy_money:recalculate_time_entry_expenses_on_project RAILS_ENV=production | Personnel costs are recalculated according to current rates and rate hierarchy | After submitting, you will be asked to enter project ID. Confirm without ID and all project data will be recalculated. Please be aware that all projects' recalculation may take a long time and will slow application for all users. |
SQLite to MySQL conversion |
Download the tool sqlite3-to-mysql.py |
Please read the whole instruction manual here. | |
Manage API request limits |
Legacy installation EASY_RACK_ATTACK_API_READ_LIMIT=200 (example) Docker solution |
|
From version 13 you need to set env variables as explained. For versions 11 and 12, follow this description. |
IMPORTANT: These commands are to be used by competent server administrators, realizing the eventual risks and effects of each operation. System failures resulting from incorrect use of the commands are on responsibility of the server admin running them. Easy Software may have limited possibilities to provide support. Server support requests (if possible to provide) are always charged by actual hourly rate.