Installing PostBooks the Long Way Update

 

gerhardpet's picture

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.

 

 

 
Arne78's picture
Offline
Joined: 09/18/2010
backup and restore

Dear Gerhard,

thank you for the manual - I took it as reason to update our xtuple server - we still used 9.0 and it was time to migrate to 9.3. Also because the xtuple upgrade from 4.4 to 4.52 failed on the 9.0 (I realized later that xtuple updated the PostgreSQL-support fastly to beginning from 9.1...). We are in China and there is no PostgreSQL-support available. From HongKong once somebody wanted to come over but ok... so I had to do it for myself and I enjoy developing/designing hardware and not setting up SQL-servers... our Chinese staff did not understand anything... but again, we are more hardware related...

Starting with the backup - just when I chose tar with PGAdmin and UTF8 I was able to restore the file also with PGAdmin. I feel this is an important information... When I chose any role I was not able to backup at all... 

I followed your manual line by line so it took me some time to fix this issue:

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

CREATE GROUP xtrole;

CREATE USER admin WITH PASSWORD 'admin'

CREATEDB CREATEUSER

IN GROUP xtrole;

I made it first line by line so the result was always wrong. And when I realized it must be one query the server already did not allow to do the query anymore because xtrole already existed... in the old manual it showed also how to change this with pgadmin click by click...

Also, I feel like you should emphasize to change the password ASAP for security reasons...

Anyhow... and before people now say you should take a consultant - I think not. We pay already several thousand dollars a year (because we have more than 10licenses standard license) just for support. The support I see are not well documented manuals and updates which so far did not improve any of our problems or integrated any functionalities we needed since we started using xtuple 2010... You can say now "sorry, doing an update is something just professionals should do". And "just professionals should set up your system". I think NO, in the 21th century software should be so easy that everybody can install and use software, even when it is for business. I used in Germany from 2001 on a freeware as my first ERP-system, based on mySQL3.2. The program had one button for backup, one button for restore.... I do not understand why xtuple is not able to integrate something like that... the same for the report builder which I feel is far too difficult to use... and when I start now complaining - we are in China and especially sales people enjoy changing or starting their own business - preferred with the contact details of the customers of the older company... We would strongly prefer the possibility to allow sales person just to see their own written invoices and customers details... but ok, I suggested that already several times and offered even already development money... but it seems we are the only one who needs a function like that...

Just my two cents... after taking some time to realize that on the new server the port was not opened for communicating I now happily look into setting up the SSL-certification...

Regards

Arne

P.S.: No word in backup and restore about user roles. At least after restore, all user accounts are gone... no word about this in the manual... we have to set up now again 30 user accounts? No way to restore that also? What said, other even free ERP programs offers all this with a click...