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?