Forum OpenACS Q&A: different databases for development and production

What is the current OpenACS best practice for maintaining separate development and production spaces, and specifically for databases?  In my "Quick install guide" I am trying to document the following setup:

OpenACS is initially unzipped to /web/openacs-dev with a database of openacs-dev.

The directory is then imported to cvs and rebuilt as a checkout.  Then, it's exported back to /web/openacs-prod.

The database is backed up, and then restored to a new database, openacs-prod.  This step is where I'm running into a problem, but I also have conceptual questions.

First, the problem.  I do this:
pg_dump -F c openacs-dev > /backup/openacs/test.dmp
pg_restore -d openacs-prod test.dmp

And I get this error:
ERROR:  function plpgsql_call_handler already exists with same argument types
pg_restore: [archiver (db)] could not execute query: ERROR:  function plpgsql_call_handler already exists with same argument types

Presumably the two databases are not as separate as I had hoped.  I also tried:

pg_restore -c -O -d openacs-prod /backup/openacs/test.dmp
ERROR:  index "index13_key" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR:  index "index13_key" does not exist

Now, assuming I get this working, that's fine for backup/restore.  But what about when you're doing work on a development server that you want to roll to production?  It would be nice to make changes in pages, check those into cvs, and then deploy them to production.

How do you change the database?  Through the APM?  In that case, you need to back up the dev and production databases separately.  And, if you want well-tested production environment, you need to set up a staging server inbetween production and dev, which has relatively live data.  You then bundle up your database changes into packages, and then test-install them on the staging server before installing them on the production server.

You can also do a switcheroo, where you lock the production database, update the staging database with current data, install the packages, and if it passes testing, promote the staging server into production and demote the old production server to staging.

But using the APM to move database changes invalidates the use of cvs to move and control page changes.  So does this mean we have to use APM (make a new package, put it in cvs, export it, and install it) just to make minor text changes on pages?

What do people think of this methodology in general?  Are people doing this?  Something simpler?  Should I document this down to the painful details?

Collapse
Posted by Jun Yamog on
Hi Joel,

Try to see if this will help

http://sdm.openacs.org/doc/openacs-4/acs-admin.html

Look at my comment below.  Its a bit dated but I may help.

Also for me its a bad practice to move database from dev -> staging -> prod.  If there are any data model changes write them down into sql scripts.  Then run them as you go up.  I only restore my database when I need to test something really hard.  Normally that is prod -> dev.

We still use CVS to control the source code.  The apm has nothing to do with controlling the source code.  Its just there to manage packages.

We have used this procedure for CCM and ACS 3.x.

Collapse
Posted by Cynthia Kiser on
My impression (correct me if I am wrong) is that OACS 4 has much of the configuration information is in the database - all set using forms on the admin interface. How do folks track / version control / roll out to production configuration changes such as permissions and other parameter changes? Did the "also dump config information to a file" idea that was tossed around when ACS 4.0 first came out ever get implemented?
Collapse
Posted by Jun Yamog on
Hi Cynthia,

I think that feature never got into reality.  Config changes are still tracked down and redone in the live servers.  Any admin stuff done on the UI is redone again the live servers.

Atleast this is still how I do it.  Although at times I just write SQL scripts that I run on dev, staging and prod servers to change the configs.

I think this is an area where we can improve on.  Export/Import of config.  Unless I am missing something major...