Thursday, September 26, 2013

avERP Migration von Windows zu Linux

avERP von Windows zu Linux Firebird migrieren.

Eine Anleitung.

Installationsschritte um von einer (single User)Windows avERP Installation zu einer Linux avERP Multiuser Installation zu kommen.

Voraussetzungen:
1) Es gibt eine bestehende Windows avERP Installation
2) Es gibt ein Linuxsystem das als Server fungieren soll. in unserem Fall Debian Wheezy 7.1 (x86)

Windows
=======

Wir vergewissern uns das die Installation funktioniert.
Eine cmd öffnen
"c:\program files\firebird\firebird_2_5\bin\gbak.exe" 
ist das Firebird Backup Programm welches wir nutzen möchten.

von hier kann das DB-Backuptool gbak.exe mit folgendem Aufruf gestartet werden:

"c:\program files\firebird\firebird_2_5\bin\gbak.exe" -b "c:\program files(x86)\averp\averp.fdb" "c:\<wo Schreibberechtigung besteht>\averpdb.fbk" -y <Pfad>\averpdb.log -v -user sysdba -pas masterkey

Das Kennwort des sysdba Users ist im Programmverzeichnis von avERP zu finden (Password.txt).


Das Datenbankbackup File kann dann z.B mit scp auf das Linuxzielsystem kopiert werden.

Wir kommen nach Abschluß der Linuxinstallation noch auf den Windows Client zurück um die Datenbankverbindung einzutragen und die Migration zu testen.

Linux
======
Firebird installieren:

Folgende Pakete wurden normal über "apt-get install" installiert:
root@TestAvERP:/var/lib/firebird/2.5/data# dpkg -l | grep fire
ii  firebird-dev                         2.5.2~svn+54698.ds4-3         i386         Development files for Firebird - an RDBMS based on InterBase 6.0 code
ii  firebird2.5-classic-common           2.5.2~svn+54698.ds4-3         i386         common files for firebird 2.5 "classic" and "superclassic"
ii  firebird2.5-common                   2.5.2~svn+54698.ds4-3         all          common files for firebird 2.5 servers and clients
ii  firebird2.5-common-doc               2.5.2~svn+54698.ds4-3         all          copyright, licnesing and changelogs of firebird2.5
ii  firebird2.5-examples                 2.5.2~svn+54698.ds4-3         all          Examples for Firebird - an RDBMS based on InterBase 6.0 code
ii  firebird2.5-server-common            2.5.2~svn+54698.ds4-3         i386         common files for firebird 2.5 servers
ii  firebird2.5-superclassic             2.5.2~svn+54698.ds4-3         i386         Firebird SuperClassic Server - an RDBMS based on InterBase 6.0 code

ich glaube "apt-get install firebird2.5-superclassic"  zieht die anderen Pakete nach.

Durch dpkg-reconfigure firebird2.5-superclassic kann das Kennwort des sysdba Users einfach geändert werden

Installation UDF (User Defined Functions)
Von der Herstellerseite die Bibliothek downloaden:
http://www.synerpy.de/cm/index.php/downloads/file/5-udf-bibliotheken.html

in einem Unterverzeichnis das FreeAdhocUDF.zip auspacken

root@TestAvERP:~/UDF# ls
COPYING                       FreeAdhocUDF_FB15.so            FreeAdhocUDF_FB2x_glibc23.so  FreeAdhocUDF_FBi64_MSVC8.dll  liesmich.txt
COPYING.LESSER                FreeAdhocUDF_FB15_SuSe10.so     FreeAdhocUDF_FB2x.so          gpl_deu.txt                   UDF_Bibliotheken.zip
Copyright.txt                 FreeAdhocUDF_FB15_ubuntu606.so  FreeAdhocUDF_FBi32_MSVC8.dll  inhalt.txt                    welche_version.txt
FreeAdhocUDF_FB15_glibc23.so  FreeAdhocUDF_FB2x64.so          FreeAdhocUDF_FBi32_oWatC.dll  lgpl_deu.txt

wir haben open mit dpkg -l... gesehen das es sich in unserem Fall um eine 32bit Version von Firebird handelt (i386). Unsere Firebird Version ist mindestens 2.x.
Daraus wissen wir das wir die Datei FreeAdhocUDF_FB2x.so verwenden müssen.
Die Datei "welche_version.txt" hilft ansonsten weiter

Die Datei  FreeAdhocUDF_FB2x.so muss in den "lib Bereich" von Firebird kopiert werden.

cp FreeAdhocUDF_FB2x.so \ /usr/lib/firebird/2.5/UDF/FreeAdhocUDF.so 

erledigt dies für uns. Die Zieldatei muss wie im Beispiel heißen - also ohne _FB2x.
Berechtigungen sollten wie folgt aussehen:
root@TestAvERP:/usr/lib/firebird/2.5/UDF# ls -la
insgesamt 232
drwxr-xr-x 2 root     root       4096 Sep 25 09:14 .
drwxr-xr-x 5 root     root       4096 Aug 12 17:36 ..
-rw-r--r-- 1 firebird firebird  17864 Mär 22  2013 fbudf.so
-rw-r--r-- 1 firebird firebird   7112 Mär 22  2013 fbudf.sql
-rw-r--r-- 1 firebird firebird 141379 Sep 25 09:12 FreeAdhocUDF.so
-rw-r--r-- 1 firebird firebird  19170 Mär 22  2013 ib_udf2.sql
-rw-r--r-- 1 firebird firebird  13708 Mär 22  2013 ib_udf.so
-rw-r--r-- 1 firebird firebird  18525 Mär 22  2013 ib_udf.sqler 



Ich denke es sollte nun eigentlich ein neuer Firebird User erstellt werden dem die Datenbank gehört. (mit gsec)
Wir überspringen diesen Schritt hier.

Hier ist es vielleicht gute Firebird neu zu starten

root@TestAvERP:/var/lib/firebird/2.5/data# ps aux | grep fb
firebird  2618  0.0  0.0   4448   792 ?        S    Sep24   0:00 /usr/sbin/fbguard -daemon -forever -pidfile /var/run/firebird/2.5/fbserver.pid
firebird  5039  0.1  0.3  81080  7336 ?        Sl   09:18   0:11 /usr/sbin/fb_smp_server
root      5367  0.0  0.0   3564   812 pts/0    S+   12:12   0:00 grep fb

Mit kill habe ich dann den fb_smp_server den Prozess beendet der durch fbguard gleich wieder frish gestartet wurde.


Nun können wir das Backup zurückspielen:
gbak -r <pfad zum Backup>\averpdb.fbk  /var/lib/firebird/2.5/data/averpdb.fdb -y <ordner>averpdb-restore.log -v -user sysdb -pass <password>

Log auf Fehler prüfen.

Die neue Datenbank in /var/lib/firebird/2.5/data/averpdb.fdb benötigt folgende Rechte:
root@TestAvERP:/var/lib/firebird/2.5/data# ls -al
insgesamt 729376c:\program files(x86)\averp\AVERPCONNECT.cfg
drwxrwx--- 2 firebird firebird      4096 Sep 25 00:16 .
drwxrwx--- 6 firebird firebird      4096 Aug 12 17:34 ..
-rw-rw---- 1 firebird firebird 746192896 Sep 25 10:50 averpdb.fdb
-rw-rw---- 1 firebird firebird         0 Mär 22  2013 no_empty
-rw-rw---- 1 firebird firebird    675840 Sep 24 16:09 test.fdb

Testen der Installation
========================

Um die Installation testen zu können müssen wir auf unserem Windows Client den DB-Connectionstring anpassen:
Mit Administratorrechten ist die Datei
"c:\program files(x86)\averp\AVERPCONNECT.cfg" zu öffnen.
Den DB-Connect String ändern/ergänzen: Hinterd em letzten ; ALIAS=<IP/hostname>:<Path to DB on DB Server>
Beispiel
;AVERPDB=172.30.0.170:/var/lib/firebird/2.5/data/averpdb.fdb;

Nun kann der avERP Client gestartet werden.

Mehere Clients sollten sich nun gegen den Linuxserver verbinden lassen.
Neue avERP Installationen benötigen nun die averpconnect.cfg

Verbesserungen:
===============
Der DB Owner sollte ggf nicht sysdba sein.
Backupspace kann durch Nutzung von nbackup verringert werden (Incremental Backups)
Der Betrieb Firebird als Super oder Classic sollte noch untersucht werden
firebird.conf kann ggf noch optimiert werden.

Viel Erfolg

Thursday, May 30, 2013

Nexus21z OK I have a terminal and a cool keyboard now what ?

Computer Terminal
So we are back in the good old days with our terminal on our tablet.
Where could I go from here. Many useful system commands are available due to busybox. I like ps and kill alot. Why - well I found this really fun game game called Hill Climb Racling. I had a lot of fun with it and it is quiet addictiv. After using ps for a while discoverd and redscover the running process of the game and after talking another look at the permissions the game asks for I was wondering what the game was doing.






Permissions

THIS APPLICATION HAS ACCESS TO THE FOLLOWING:

  • NETWORK COMMUNICATION
    FULL NETWORK ACCESS
    Allows the app to create network sockets and use custom network protocols. The browser and other applications provide means to send data to the Internet, so this permission is not required to send data to the Internet.
  • PHONE CALLS
    READ PHONE STATUS AND IDENTITY
    Allows the app to access the phone features of the device. This permission allows the app to determine the phone number and device IDs, whether a call is active, and the remote number connected by a call.
  • STORAGE
    MODIFY OR DELETE THE CONTENTS OF YOUR USB STORAGE
    Allows the app to write to the USB storage.
Hide
  • NETWORK COMMUNICATION
    VIEW NETWORK CONNECTIONS
    Allows the app to view information about network connections such as which networks exist and are connected.
  • SYSTEM TOOLS
    TEST ACCESS TO PROTECTED STORAGE
    Allows the app to test a permission for USB storage that will be available on future devices.



    I knew the device wouldn't leave me with much privacy but thinking that even small software firms could track millions of users with their application is still discomforting to me.

    It becomes more and more difficult to preserve a reasonable level of privacy. This is still a project to address. I mean the software that is on our phones and tablets now would be flagged as spy ware if it was on a PC and moved to a quarantine folder to be disinfected.
    I still need to fine my personal solution to this problem.
    I'll keep you updated.


Wednesday, May 29, 2013

Introduction

Project21/z will be a blog where I will document small IT related projects of mine. Maybe it can help others with there projects as well.

At work I can't choose my OSes but at home I can.
Free software has so much to offer and I love to use it at building blocks for my projects. I want to thank everyone who contributes to the knowledge sharing.




Project Nexus21z

The Nexus 7
I didn't really want to have a tablet. I like to do interesting stuff on computers and my laptop is just not what I want to carry around much. So maybe I should take another look at tablets. Years ago I was doing soon cool stuff on my MDA III with WindowsCE so I knew this could also become interesting and fun. I went to a shop to compare some tablets but besides the Ipad mini I liked the nexus 7 the best. Form factor design weight and technology as well as the promise of updates for the android platform made me choose this device. I like the hardware even though my first nexus 7 broke after 3 weeks. But the thing was very responsive and the screen is very good. Sound  could be a little better but that's not why I bought it. I haven't looked that deeply into the android scene and didn't know much about it except that this thing could be rooted without much effort.


After some searching I found the Nexus 7 toolkit to root the device.
At first I didn't know exactly what to do and what steps needed to be taken when but I found a post by someone pointing out how easy it is.


turn on usb debugging mode
download the Nexus 7 toolkit
find out your device build number:
  1. settings-> About tablet
start toolkit / install driver (comes with toolkit)

Nexus 7 toolkit screen
Nexus 7 toolkit screen


click here for more info








Select this to root device












 Just follow the instructions on screen and device.
 -Yeah rooted-

OK now I have a rooted device but what now ?
 I like the device but I wanted it to be able to do much more than to run apps. The first thing that comes to mind is having access to a shell and unleashing the power of the command line.
After testing out some terminal applications in the play store I found a combination of two apps that work very nicely


So after installing and configuring the apps it looks like this:



click here for more info





This will be the start for a nice phone/tablet Linux with super powers.

I have my issues with android and it's tight google integration. Not sure if i can find a cure for this problem. (PDroid maybe?)

My next posts will be a little more about the Nexus 7 and more Linux