1.4. Maintenance

1.4.1. Backup

All data in Cyclos is stored in the database. Making a backup of the database can be done using the pg_dump command. The only file that you need to back-up (only once) will be the cyclos.properties configuration file. The database can be backed up manually as follows (in this example the name of the database is cyclos4 the username cyclos and the command will prompt for the password cyclos):

Linux:

pg_dump --username=cyclos --password -hlocalhost cyclos4 > cyclos4.sql

Windows:

pg_dump -U cyclos -d cyclos4 -f cyclos4.sql

1.4.2. Restore

If you want to start using cyclos with the data from a backup. You can just import the backed up database. In this example the name of the database is cyclos4 the username cyclos and command will prompt for the password cyclos the name of the backup is cyclos4.sql make sure to specify the path if your not in the same directory as the file:

Linux:

psql --username=cyclos --password -hlocalhost cyclos4 < cyclos4.sql

Windows:

psql -U cyclos -d cyclos4 -f cyclos4.sql

1.4.3. Reset admin password directly on database

If you lost the password of your global administrator, it is still possible to update the value on database directly. To reset the password to 1234, run the following sql in the postgresql query tool (psql). First, find the identifier of the password type used for login (when executing this command make sure you are in the Cyclos database \c cyclos):

select id, name
from password_types;

Then, update the password for the user 'admin' and that specific type:

update passwords
set salt=null, value='$2a$10$yM.uw9jC7C1DrRGUhqUc3eSR6FCJH0.HdDt3CJs8YL56iATHcXH7.'
where user_id = (select id from users where username='admin')
and status = 'ACTIVE'
and password_type_id = <password_type_id_from_last_command>;

Please make sure to replace the name 'admin' to the username used for the global administrator. Also a common mistake is that people forget to login as global administrator into the global url e.g. http://www.cyclos-domain/global.