+1-757-461-3022 x124

Installing PostBooks the Long Way Update

Sunday, June 1, 2014

Perry Clark, systems engineer at xTuple, wrote a blog post on installing PostBooks® the long way. Some things have changed in the latest version of PostgreSQL. As of this writing, I'm using PostgreSQL 9.3. The PostgreSQL version Perry used is 8.4. If you are new to xTuple and PostgreSQL, you should read Perry’s blog post first.

I will not provide the details on installing PostgreSQL, which is straight forward, as with any other software program. I'm using Windows 7 for this blog post.

First, download the latest version on PostgreSQL here http://sourceforge.net/projects/postgresql.mirror/?source=directory

Then, download the latest xTuple GUI client here http://sourceforge.net/projects/postbooks/files/02%20PostBooks-GUIclient-only/

Then, download the latest xTuple database here or which ever version you want to use http://sourceforge.net/projects/postbooks/files/03%20PostBooks-databases/ 

Download the empty, quick start or demo database.

Now, we are ready to start.

Install PostgreSQL. After the installation is done open pgAdmin III. If the installation completed successfully, we should have the localhost server listed.

Next, connect to the localhost server with the password you provided while installing PostgreSQL. Once connected, we have a database called postgres.

Now, we have some setup to do for restoring and using an xTuple database. We need to configure the Template1 database to use as the template for restoring an xTuple database. By default you will not see the Template1 database.

Go to File > Options and check off “Show System Objects in the treeview”

Now click on and highlight the Template1 database. Open the query window by clicking on the SQL magnifying glass.

The query windows with template1 database selected will open.

Now, we need to setup the pgcrypto extension for credit card encryption in xTuple. To do so execute this query:

create extension pgcrypto
To confirm that the extension installed properly execute this command:
select * from pg_available_extensions
Scroll down the list and you will see the pgcrypto extension installed.

Next, execute the following query which will create the group xtrole and the admin user.

-- This script creates the group xtrole and the user admin
-- Create the xtrole group

CREATE GROUP xtrole;

-- Create the admin user with createdb and createuser permissions. Place the user in the xtrole group and set the password to the default of admin.

CREATE USER admin WITH PASSWORD 'admin'

CREATEDB CREATEUSER

IN GROUP xtrole;

Once done, close the query windows and go back the database tree view.

Right click on databases and select “New Database”

I’m going to use the PostBooks demo database. In the new database, windows give the database a name. In my case, I’m naming it “pbdemo” Then, go to the Definition tab. For template you are going to select template1. This is the database template we prepared in our previous step. Click on OK.

Now, right click on the database we just created. Click on Restore...

For format we will use the default Custom or tar option. Browse for the filename database you downloaded. Select the xtrole for the rolename

Click on Restore.

Once the restore is done, you should have an exit code in the window.

If the exit code is 1, this means the restore was successful. You can safely ignore the WARNING. Perry’s blog post has a good explanation on this.

Close the restore window.

We are done and ready to load the GUI xTuple client.

Gerhard Peters

Founder at Interaction Versa
Gerhard is an Authorized Consultant in the xTuple Partner Channel. His company provides knowledge sharing and advising businesses executives on becoming more proficient using enterprise software; solving inventory and manufacturing processes problems for small to mid-size distributors and manufacturers. Gerhard is experienced with ERP systems and eCommerce solutions with a strong business background helping his father build a successful company. He is a passionate Entrepreneur leading a dedicated team of knowledge workers at Interaction Versa helping business get more value out of their consulting and software investments.