Installing PostBooks... the long way.

 

pclark's picture

While we do publish PostBooks Installers that will quickly and easily install PostBooks, some people like to make the installation a fun little project by installing the individual components.  And really, it's not a bad way for you to practice installing, or to get hands on experience with some of the pieces that we try to hide from you in the packaged installers.  This will be like taking a long walk, but in the end, it's the journey that counts.  Now, if you've been following my writings/ramblings for a while, or if you have met me in person, you know that I'm fiercly aligned with the Penguin Nation, that is, I use, recommend, endorse, and otherwise try to sell everyone on using some flavor of Linux.  Well, In this blog, you'll notice I don't say "Now, go to 'terminal' and..." .  Yep - ALL GUI.  How's THAT for a surprise?  The other surprise is that I wrote this using screen shots from Windows 2000.

          Two roads diverged in a wood, and I--
          I took the one less traveled by,
          And that has made all the difference.
                   
- Excerpt from The Road Not Taken by Robert Frost (1915)
 


First of all, get all of your ingredients for your trail mix together and settle in with a large beverage.  We're going to assume that you have a PostgreSQL free environment - No Finks, Yums, Apt-Gets, xTuple Installers, etc... We're starting fresh and clean here.

=== UPDATE === UPDATE === UPDATE === UPDATE === UPDATE === UPDATE ===

Anyplace where I'm asking you to download a 3.5.4 database or use a 3.5.4 client, these instructions should hold true for installing a more recent version.  Just substitute the version numbers, because I'm too lazy to update this whole page.

Get the most recent PostBooks databases here: http://sourceforge.net/projects/postbooks/files/03%20PostBooks-databases/

And the GUI Client for your platform of choice here: http://sourceforge.net/projects/postbooks/files/02%20PostBooks-GUIclient-only/

Oh, one other thing... Running PostgreSQL on Windows 2000 is a really bad idea.  Evidently, it's possible, but is highly frowned upon...

Also, be careful with PG 9.0 as of xtuple 3.6x and prior.  When this was initially written, I hadn't done a whole lot of thorough testing with PG 9.0, but it will be awesome once we've ferretted out our issues.

=== UPDATE === UPDATE === UPDATE === UPDATE === UPDATE === UPDATE ===


List of stuff you'll need:
(1) The latest PostgreSQL 8.4 Installer (or even PostgreSQL 9.0 - TESTING ONLY! REALLY! i.e. NOT FOR PRODUCTION. There are bugs, you've been warned.)

Find the EnterpriseDB PostgreSQL Installer for your beloved server's OS and the architecture (32 or 64 bit)
http://www.enterprisedb.com/products/pgdownload.do

(2) The PostBooks Databases and Initialization File (please see update above)
Initialization File (init.sql)
3.5.4 Quickstart Database
3.5.4 Empty Database
3.5.4 Demo Database
  
(3) The PostBooks 3.5.4 Client for your client OS's.
3.5.4 Windows Client
3.5.4 Mac Universal Client
3.5.4 Linux Client

And that's it for the main ingredients.

Oh, I suppose we should install these things...  Thought it would be that easy huh?  Quick little hike... No, No, No, Padawans!  Your journey has just begun.  First as root, or Administrator, or Admin, or RunAs start off by starting up the the EnterpriseDB PostgreSQL installer.

Click the 'Next' button.

Select your installation directory - The default is usually fine for simple installations.  Click 'Next'.

Select where you want your PGDATA directory to live.  You could select a fancy RAID, or SAN, or other storage device.  In this case, we're just accepting the default.  Click 'Next'.

Enter in a password for the PostgreSQL service user name 'postgres'.  The postgresql service does not run as a privledged user (i.e. root, Admin, etc.). Click 'Next'.

Select the port that the PostgreSQL service will listen on.  5432 is the default, but you can set it to something different if there are no conflicts.  Click 'Next'.

Select your Locale.  Your locale should be UTF-8 by default, you can research it if you need another locale.  Click 'Next'.

If you've got this far, the installation will commence once you click 'Next'.

PostgreSQL is installing, using all of the information you have supplied.  DO NOT CLICK 'Cancel'!  (Unless you don't want to install the greatest database ever invented with the greatest ERP system ever invented...)

UNCHECK the StackBuilder checkbox and click 'Finish'.  You can play with StackBuilder later, it is pretty cool.

Once installation is complete, you should have a running PostgreSQL!  Go into your menu and look for PostgreSQL 8.4 or 9.0 and Launch PgAdmin3.  Click on the little power plug icon and add a new host.  Your installation may have the local installation already setup, but if not, you can enter your information here.  'localhost' refers to THE computer you are sitting infront of.  You can also specify a remote host to connect to.  Remember your 'postgres' user password?  You'll need that too.  Click 'OK' once you've entered everything in.

This is what you should be presented with if all is right with the world - if you had this without doing the previous step, congratulations!  Take a quick little break.  Now we have a little bit of setup work to do before we can load the PostBooks databases.

Expand out the Database Cluster tree in the left hand pane.  Look for the template1 database.  If you don't see it listed, go to File -> Options, click on the 'Display' tab check the 'Show System Objects in the treeview' check box at the top of the screen and click 'OK'.  You can restart pgAdmin, or click the REFRESH button (NOT THE RECYCLE TRASHCAN) next to the PLUG icon.  Once you get the template1 database showing, select the template1 database and click the SQL button (6th button from the left).  This will bring up the Query window.

Once the Query window is displayed, we need to load up pgcrypto so that the credit card encryption and other things work properly in PostBooks.  Click on File -> Open, if it asks about saving text, click NO.  The file we're looking for is in the 'contrib' directory of wherever PostgreSQL has been installed.  In this case, the path is shown at the top of the image.  On Linux this is usually in the /opt directory, on Mac, it ends up in Applications/.  Once you have found pgcrypto.sql, open it up, and run it - Click the green 'Play' button.  Oh - did you notice at the top of the image the drop down list where it says what database you're connected to 'template1 on postgres@localhost:5432'?  That's good to know that we're in the right database applying this script.  We'll do the same process with the initdb.sql script that you downloaded.

Load up the initdb.sql script also and press 'Play' again.  If you read it, you'll see that it's creating a GROUP named 'xtrole', and a USER named 'admin' with the PASSWORD of 'admin'.  Once you've run this, great.  Close the Query window and go back to the main database tree view.

Right click on the word 'Database' in the tree view and select 'New Database'.

Let's create a database named 'empty'.  The Owner should be 'admin', the Encoding should be 'UTF8' (always), the Template will be 'Template1'.  Leave everything else and click the 'OK' button.

Back on the main tree view, you should now see that you have a database named 'empty'.  Now we're going to restore the PostBooks 'Empty' database version here.  Right click on the 'empty' database and click 'Restore'.

Navigate to whereever you downloaded the database files to and select the postbooks_empty-3.5.4.backup database and click the 'Open' button.

The 'Restore Database' dialog will display.  Click the 'OK' button to restore this database to the 'empty' container.

Once the restore has completed, you should see a dialog like this.  The highlighted WARNING above is normal.  Those warnings are there because the pgcrypto functions already exist in the 'empty' database container because we used 'template1' when we created it.  This is really quite ok.  Click 'Cancel', it's a little quirky, but clicking 'OK' again will try to do the restore over itself again.  Click 'Cancel', trust me.  You can repeat the create db and restore process for the quickstart and demo databases if you so desire.  Hey!!! Guess what, we're almost done, we can at least fire up a client and check out that it all works now!!!

Extract the client from it's zipped up state and get it put someplace accessible on your drive or network.  Start the client by clicking on the executable, and click the 'Options' button.

Enter in your database information - If you're playing along at home, Server = localhost, Database = empty, and the Port = 5432.  Click the 'Save' button.

Now, you can enter your user name and password of admin/admin and click the 'Login' button.

Success!  You've made it to the end of your first install!  Pat yourself on the back, rest your eyes, pet your dog, scratch your cat, and kiss your spouse!  You've certainly come a long way, but of course, there's additional READING to do, and some other things that you must do.  I suppose you will want to connect from other computers, so you'll need to learn how to modify the pg_hba.conf and postgresql.conf files and perhaps set your OS's firewall rules to allow access to the PostgreSQL port - You can learn how to do all that by reading all of my blog posts and some others on our site.  Here are some VERY useful links, you should check them all out.  These will make ALL the difference!

My xTuple blog

Chris's xTuple blog

Installing PostgreSQL from Source

The PostgreSQL 8.4 Documentation

And if you've found this walk-through the installation useful, please leave some comments below!

 
gayathri's picture
Offline
Joined: 10/17/2010
hai am new to open source i

hai
am new to open source
i have interest to do some project
but i known only some c and c++ coding
am just studying my 3th year B.Tech
if u help me and by having some team i can improve myself
please help me

 
erikosmond's picture
Offline
Joined: 10/06/2010
Great walk through

Thanks for the walk through! This is exactly what I wanted. I am excited to use this product. I looks like an ideal ERP open source solution. Funny it was done on a Windows 2000 install. The instructions worked just as well for Mac OSX, with a few refresh tweaks, and finding the pgcrypto.sql in /Library/PostgreSQL/9.0/share/postgresql/contrib . I probably should have just used searchlight...

 
sevendogzero's picture
Offline
Joined: 10/21/2009
Holy Grail

xTuple is lucky to have a clear thinker to put this information together.

 
Kamaugikonyo's picture
Offline
Joined: 11/28/2010
Version mismatch

Hi. I have followed all the steps above and everything went fine to the point of logging into 'a server I specify'.
I set everything to work with the 'empty' database and inputed the username and password.
On hitting enter I get this message.
Version mismatch.
The version of the database you are connecting to is not the version this client was designed to work against. This client was designed to work against the database version 3.6.0. If you continue some or all functionality may not work properly or at all. You may also cause other problems on the database.
Do you want to continue anyway?

On hitting OK, xtuple disappears and nothing happens.

Please assist with this problem.
Thanks in advance.
Kamaugikonyo

 
ned
ned's picture
Offline
Joined: 10/20/2008
What version of the "empty"

What version of the "empty" database did you install? It sounds like something other than 3.6.0.

By the way, generally, if you're looking for help, it's better to ask in the forums than attaching comments to documents like this.

 
pclark's picture
Offline
Joined: 12/09/2008
Version of empty

Hello,

If you have installed these instructions as written, chances are that you have version 3.5.4 databases (as that was what was available when written). You can either upgrade these databases to 3.6.0, or download the 3.5.4 client.

Hope this helps,

Perry Clark
xTuple

 
gerhardpet's picture
Offline
Joined: 08/19/2012
Now with PostgreSQL 9.1 to

Now with PostgreSQL 9.1 to install pgcrypto it no longer works as per this blog

Maybe someone can confirm this but this worked for me

Select the Template1 database and click the SQL icon in pgAdmin III

execute this command "create extension pgcrypto" To confirm that it is installed run this command 'select * from pg_available_extensions'

Here is a source with more info
http://stackoverflow.com/questions/8000740/how-do-i-install-pgcrypto-in-...

 
djcashmore's picture
Offline
Joined: 01/22/2013
Thank you a million times ....

After struggling for over a day trying to install your article has finally got me in. Std install did not work with Win 7 Pro, and installing PG first did not work either. In the end I had to install PG into a non program directory and then follow your instructions (with a few mods for newer versions.).

Regards

Dave

 
singogli's picture
Offline
Joined: 05/24/2012
manual install of xtuple succeeds on 64 bit Ubuntu 12.04

I have successfully installed xtuple version 4.0.3 on a 64 bit Ubuntu 12.04 distribution the very long way.
This procedure starts with a fresh install of most recent Ubuntu 64 bit desktop to highlight what may be missing in an existing 64 bit Ubuntu system to successfully install current xtuple version.  It also contains steps to alleviate non-intuitive difficulties a beginner might have, such as disconnecting a default postgresql template in pgadmin3 before attempting to modify it.  The 32 bit libraries ia32libs and ia32libs-gtk may or may not be neccessary but they do allow the xtuple installer to at least produce an error message, without them the xtuple installer did nothing and provided no clue as to the problems. The xtuple installer is not required to complete this procedure.
Please note the enterprisedb installer for 64 bit postgresql-9.1 also had a .run file problem
on this system configuration, this may have been because the 32 bit libraries had not yet been installed but I suspect it is the same bug as the xtuple installer.
 
This is a checklist for the install, it may only work on Ubuntu 12.04 64bit desktop.
Refer to the blog to understand some of the details.  

1. Install Ubuntu 12.04 64 bit desktop
2. Do all system updates with update manager
3. execute "sudo apt-get install ia32libs ia32libs-gtk"
4. execute "sudo apt-get install postgresql-9.1"
5. Download from Sourceforge xtuple ver 4.0.3 init.sql, database backups desired and GUIclient
6. execute "sudo apt-get install pgadmin3"
7. Edit /etc/postgresql/9.1/postgresql.conf add/edit a line "listen_addresses = '*'" save/exit
8. execute "sudo su service postgres restart"
9. execute "sudo -u postgres psql postgres"
10.enter "\password postgres"  -Enter desired password when prompted-enter "Ctrl d"
11. execute "sudo apt-get install postgresql-contrib-9.1"
12. run pgadmin3
13. Right click postgresql-9.1 and select connect
14. Select on top level menu File- Options - Browser
15. Check Show System Objects in the tree view, OK
16. Right click Databases - Refresh
17. If template1 has no red x right click template1, click disconnect
18. Click template1, click sql query in menu bar
19. Type CREATE EXTENSION pgcrypto in SQL Editor, click Execute query button in menu
20. Close query window
21. Click sql query in menu bar
22. Click Open file in Menu bar
23. Browse to init.sql and open
24. Click Execute query in menu bar
25. Right click template1 and disconnect
26. Create new databases empty, quickstart and demo
27. Right click Databases in Object Browser and select New Database
28. Insert Name and Owner in Properties tab, then Template in Definition tab
29. Example: Name- empty. Owner- select admin, Template- select template1
30. Right click newly created database empty and click restore
31. Browse to previously downloaded backup file postbooks-empty-4.0.3.backup and click restore
32. Allow restore to run, it takes a while, when restore button reappears click cancel
33. Repeat two previous steps for databases demo and quickstart
34. Extract the xtuple GUI from the previous download
35. cd to your download directory and execute "sudo tar -xvf xTuple-4.0.3-Linux.tar.bz2"
36. cd to newly created xTuple-4.0.3-Linux directory
37. execute "sudo ./xtuple"
38. At this point the xtuple login screen should appear.
38. Return to the graphical instructions above for xtuple login instructions.
Good Luck!