Useful server commands

server administration

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
  • sudo service puma restart
  • sudo service nginx restart
  • sudo service easy restart
  • systemctl restart puma@APPLICATION_NAME.service
  • systemctl restart puma@[application_name]
  • restarts puma (app server)
  • restarts nginx (web server)
  • oldest VMs (until 03/2019)
  • old VMs (from 03/2019)
  • new VMs (from 03/2022)
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
rails c -e production
RAILS_ENV=production 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
ActiveRecord::Base.connection.execute(“update issues set estimated_hours=5 where estimated_hours >= 5“)

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
show databases;
use databasename;
update issues set estimated_hours=5 where estimated_hours >= 5;

  • runs a custom sql query (mysql console)
  • list of existing databases
  • On your own risk! See note above
  • In Easy Software VMs, credentials are not required
Working with backups
  • mysqldump -u user -ppassword -h host databasename > mydump.sql
  • bundle exec rake db:drop db:create RAILS_ENV=production
  • mysql -u user -ppassword -h host databasename < mydump.sql
  • db dump
  • recreate the database
  • db import
Project tree is broken rails c production
recalculates the project tree – correct parent and subprojects
  • May happen after DB migrations. Project structure in list (URL: /projects) doesn't correspond to the breadcrumb (when accessing a sub-project)
  • Detailed manual available here.
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
This activates the currency in the system

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 SQLITE3_DUMP_FILE.sqlite3 .dump | python | mysql -u root -p sqlite3_convert

  Please read the whole instruction manual here.

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.

Try Easy Redmine in 30 days free trial

Full features, SSL protected, daily backups, in your geolocation