Friday, April 26, 2013

MariaDB/MySQL Database Backup on Fedora

This procedure requires you first setup the TTRSS UTILS environment described in the post:  TTRSS  UTILS - Fedora Tiny Tiny RSS Utilities

This method uses CRON under your own userid and pulls db_name and db_user information from your TTRSS config.php

Backup files will be stored in $home/ttrss_maint/db_backup/ and will be retained for 14 days.


Create a .my.cnf file in your home directory:

[mysqldump]
user=root
password=your_mysql_root_password

Secure the file:  chmod 600 .my.cnf

Copy the contents of ../ttrss_utils/sample_conf/mariadb_db_backup_crontab into your crontab:  crontab -e
Replace xxxxx with your account_name.

If you wish to run the backup manually:
  1. cd $home 
  2. cd ttrss_maint/ttrss_utils 
  3. ./mariadb_cron_backup

Wednesday, April 24, 2013

MariaDB is replacing MySQL in Fedora - Tiny Tiny RSS

MariaDB will be replacing MySQL as the default beginning with Fedora 19.  Fedora 19 is scheduled to be released in July, 2013. 

If you are running Tiny Tiny RSS and wish to convert now, I would suggest the following sequence:

As root:
systemctl stop ttrss-update.service
systemctl stop httpd.service
systemctl stop searchd.service
systemctl stop mysqld.service


>>>> Follow these instructions...

>>>> Then issue the upgrade command to clean things up for mariadb:
systemctl start mysqld.service
mysql_upgrade -u root -p

>>> Enter your mysql root password to continue

>>>> When finished restart the mysqld.service
systemctl restart mysqld.service

>>>> Now bring the rest of it back up
systemctl start seachd.service
systemctl start httpd.service
systemctl start ttrss-update.service


You're done.

Update Tiny Tiny RSS as a Fedora Service

If you are using postgresql:
Download rss-update.service

As root:
Place the file in:  /usr/lib/systemd/system/

Issue the following commands:
systemctl enable rss-update.service
systemctl start rss-update.service


If you are using mariadb/mysql:
Download ttrss-update.service

As root:
Place the file in:  /usr/lib/systemd/system/

Issue the following commands:
systemctl enable ttrss-update.service
systemctl start ttrss-update.service

You're done.

How to install Sphinx in Fedora for Tiny Tiny RSS


The generic instructions can be found here:

Tiny Tiny RSS Wiki: SphinxSearch

sudo dnf install sphinx

Download the Fedora specific TTRSS configuration file for the database you are using here:

Fedora Sphinx (Pre-version 2.2.6) Configuration for Tiny Tiny RSS - PostgreSQL

Fedora Sphinx (Pre-version 2.2.6) Configuration for Tiny Tiny RSS - MariaDB

Fedora Sphinx Configuration for Tiny Tiny RSS - PostgreSQL

Fedora Sphinx Configuration for Tiny Tiny RSS - MariaDB

Place the above configuration file in /etc/sphinx as sphinx.conf - make the few necessary configuration changes to reflect how you created the PostgreSQL or MariaDB/MySQL database and you should be good to go.

Run the indexer to create the full-text index of the ttrss database:
sudo /usr/bin./indexer --all

Now enable the Sphinx searchd service:
sudo systemctl enable searchd.service

Now start the Sphinx searchd service:
sudo systemctl start searchd.service

Last but not least, modify your Tiny Tiny RSS configuration to activate Sphinx.  The configuration is located at:  /var/www/html/ttrss_directory/config.php
where ttrss_directory is the name you used, i.e. ttrss, rss, etc.

change:
define('SPHINX_ENABLED', false); to define('SPHINX_ENABLED', true);

Now setup automatic update of the search indexes:
sudo crontab -e
@daily /bin/indexer --rotate ttrss >/dev/null 2>&0 # Same as 0 0 * * *
*/20 * * * * /bin/indexer --rotate delta >/dev/null 2>&0 # Every 20 min


Write the file with :wq and you're done.