How can I move Urchin 6.x and all of the report data to another server?

How can I move Urchin 6.x and all of the report data to another server?

Moving Urchin 6.x from one server to another requires the following basic steps:

  1. Prepare Urchin DB
  2. Install Urchin 6.x on the new server
  3. Move Urchin reporting databases for the profiles
  4. Move custom files and templates
  5. Apply Urchin custom settings
  6. Check new file permissions
  7. Reactivate Urchin license

NOTE: The following detailed instructions can be applied to cross-platform moves as well. The Urchin reporting database files can be moved to any operating system supported by Urchin. Considerations when moving data and files from one platform type to another include command line syntax (such as adding './' for Unix systems). Other considerations include directory syntax changes such as 'Standard\Windows\folders\' vs. '/standard/unix/directories/.'

1. Prepare Urchin DB

This step can be skipped, if you are going to use the same DB server for your new Urchin installation. Otherwise Urchin DB should be prepared before making fresh installation at the new server:

a. Create empty Urchin DB with proper permissions for Urchin user.

Example of SQL commands for MySQL back-end DB creation:

 

   mysql> create database urchin character set utf8;
   mysql> GRANT ALL ON urchin.* to 'urchin'@'localhost' IDENTIFIED BY 'urchinpassword';

Example of PSQL commands for PostreSQL back-end DB creation:

 

   postgres=# CREATE DATABASE urchin WITH ENCODING 'UTF8';
   postgres=# CREATE USER urchin WITH PASSWORD 'urchin password';
   postgres=# GRANT ALL ON DATABASE urchin TO urchin;
   postgres=# \connect urchin;
   postgres=# CREATE LANGUAGE 'PLPGSQL';

b. Copy Urchin DB data from old server by making SQL dump of the old DB and importing it to the new DB. This will automatically copy most of the needed Urchin configurations including Profiles, Log sources, Users, Accounts, Groups, Scheduler and other settings.

Example of SQL commands for MySQL back-end DB below:

  • Source DB:

 

   mysqldump –h {oldDBhostname} –u {username} –p {urchinDBname} > urchin.sql
  • Destination DB:

 

   mysql –h {newDBhostname} –u {username} –p {urchinDBname} < urchin.sql

Example of PSQL commands for PostreSQL back-end DB below:

  • Source DB:

 

   pg_dump -h {oldDBhostname} -p {oldDBport} -U {username} {urchinDBname} > urchin.sql
  • Destination DB:

 

   psql –h {newDBhostname} –p {newDBport} -U {username} {urchinDBname} < urchin.sql

2. Install Urchin 6 on the new server

Create a fresh installation of Urchin 6 on the new server using the previously prepared DB.

(Be sure to uncheck "Delete and recreate Urchin specific database tables if they exist" option for Windows installations or answer NO to “Would you like to initialize the configuration database during install?”for Unix installations!).

Detailed instructions on installing Urchin can be found here (skip DB configuration steps and start from "Installing Urchin" chapter):

Stop urchin deamons or services before proceeding to the next steps:

 

~/urchin/bin/urchinctl -stop

3. Move Urchin reporting databases for the profiles

By default, all Urchin reporting data is stored in a subdirectory of the main Urchin directory: ~/urchin/data/ This directory should be archived to maintain the subdirectory structure, then moved to the new server after installing Urchin there. It should be restored in the same directory location on the new server whenever possible: ~/urchin/data.

NOTE: If the old Urchin installation used custom history and reports directories, the custom directories should be copied (instead of ~/urchin/data/reports and ~/urchin/data/history)

4. Move custom files and templates

Customizations made to Urchin, including custom log formats and report sets, are not kept in Urchin's "data" directory. Rather, these customizations are kept in a separate location under the "lib" directory of the Urchin distribution. When Urchin is installed on your new server, any customizations that have been made to the old Urchin system will need to be copied to your new Urchin installation. These files are usually kept in ~/urchin/lib/custom/.

To do this, go to the old Urchin server and navigate to the "lib" directory of the Urchin distribution. Next, create an archive of the entire "custom" directory (and all subdirectories) using an archive utility like tar or ZIP. Copy this archive over to your new Urchin server and unpack it in the "lib" directory of your Urchin distribution.

5. Apply Urchin custom settings

If default settings have been changed for the old Urchin 6.x installation in:

 

/etc/session.conf
/etc/urchin.conf
/var/urchinwebd.conf

then don’t forget to apply the same settings in your fresh installation by editing corresponding files.

6. Check new file permissions

After all files have been moved to the new server, you should perform a thorough check to ensure that all files have the required permissions and that all files are owned by the same user (UNIX systems only).

To fix Urchin permissions, run the following command from the ~/urchin/util/ directory:

 

        inspector -r

To check for file ownership (UNIX only) run the following command from the ~/urchin/ directory:

 

        chown -R urchin_user:urchin_group ./

7. Reactivate of Urchin license

Start urchin deamons or services.

 

~/urchin/bin/urchinctl start

After completing the Urchin installation, open the Urchin web interface.

The system should display the “License Urchin” screen with “Reactivate License” link:

Since Urchin has been installed using the existing previously prepared DB, the system key has changed and the license should be reactivated.

NOTE: Please ask your Urchin reseller to reset the license before reactivating.