xTuple.com xTupleU Blog & News Customer Support

Upgrading an older web-enabled database

My current production database is a web-enabled version 4.8.1 running on Ubuntu 14.04 postgresql 9.3 (not a virtual machine)

After over a week of trying many different approaches (too many to detail here), I have not found a way to upgrade the database.

xTuple was first installed on this machine as 4.7.0 using xtuple-server (the precursor to xtuple-admin-utility)
I later upgraded the database to 4.8.1 using xtuple-server.
I have installed xTau from git, and am able to view the existing clusters through the menus, after fixing pg_hba.conf.

Most recently I have tried to use the “Copy Database” menu item in xTau. The backup succeeds, but the subsequent restore fails with lots of errors about missing functions and relations.
My guess is that the copy database script does not initialize the new database correctly before doing the restore ( I have read some of the posts about manually running sql that deals with the plv8, xt.jsinit, and uuid_generate_v4 problems) I have tried doing this manually, but there must be something I am missing.
Some of the reccomendations in the xtuple unversity manual as well as some previous forum posts seem to be out of date. For example:
The documentation here refers to a menu item called “upgrade xTuple database” that isn’t there in the current version.
Also the documentation refers to using a menu option called “install web-enabled xtuple” that is marked as depreciated in the current xTau menu.

On a separate box, have made a fresh install of Ubuntu 16.04 and xtuple-admin-utility from git.
I tried to create a blank web-enabled 4.8.1 that I could restore a backup to, but that did not work. When I try to use xTau to install a new blank database of version 4.8.1 it appears from the terminal output that it installs 4.11.2 on the machine, and then tries to restore the 4.8.1 database to it, which fails.

If anyone has successfully performed an upgrade using these tools, please let me know how you did it!

I have tried to fall back to using Updater, but it cannot be used to upgrade a web-enabled database.
If anyone knows a way to “un-mobilize” the database, so that I could then backup my data, restore to a blank database on a new machine - where I can then use updater - let me know as this may be my only way forward.


We just fixed a handful of problems in xTAU in the past couple of days, including the plv8/xt.jsinit/… initialization errors* and the problem with downloading the wrong database to restore (4.8.1 vs. 4.11.2).

I’ll look into the upgrading problem you raise. I know you can upgrade an existing web-enabled database from the command line with build_app.js. This requires setting up the proper config.js to point to the database and server, cloning the xtuple repository, and checking out the right tag (e.g. v4.11.2). I have not done this myself so won’t go into too much detail.


* You should get only one or two messages now: something like “the xt schema already exists” and possibly one about xt.js_init. Any more than that and you’ve hit something new.

Hi Gil,

Thanks for looking into this. I will look into the build_app script to see if I can use that to upgrade my database - now that I have a copy of the database to try it on. If you come across any documentation for that, please point me to it.

With regard to the “Copy Database” menu item. I tried it again with the updated xTau and the process completed, but still had issues. In addition to the two errors you mentioned, there were also a couple of “unrecognized configuration parameter” errors (see image).

I’m not sure if that is a bug, or if it is possibly an issue with the original database.

Looking at the copied database in pgadmin, it appears everything is there, but when I went to login with the 4.8.1 client, I got an error for having more that one function called js_init (see image)

From pgadmin, I looked at the two functions and deleted the one that seemed to be the dummy function.
After that, I was able to login, and everything seemed to be okay.

Thanks again for your help.