I have a customer who wants to upgrade an old 126.96.36.199 APM database to the latest release 10.1.0.15.
Unfortunately he is having many issues there, because during the upgrade of EM and postgres (8.3.12 to 9.2.9), plenty of errors showed up in the em.log and other logs.
Then he I tried several scenarios in a test environment, no one leading to a success.*** Scenario 1:1. db install of 10.1.0.15 with EM installer2. restore backup to PostgresTables and more got already created so I cannot restore the old versioned db without errors.*** Scenario 2:
1. Create backup (logged in as DB superuser wily): ~> pg_dump -h $DBHOST -p $DBPORT apmdb > apmdb.sql2. DB install of 10.1.0.15 with EM installer
3. Rename the superuser 'postgres' to 'wily'4. Drop DB apmdb postgres=# DROP DATABASE apmdb;5. Create and empty DB apmdb with owner apmdbadm. postgres=# CREATE DATABASE apmdb OWNER apmdbadm;
6. setup db user as it was with old installation7. Restore database from old versioned DB ~> psql -h $DBPHOST -p $DBPORT apmdb < apmdb.sql
8. upgrade EM
At this point, EM is 10.1.0.15, DB is new with restored data BUT is missing appmap tables and possibly more which is required by new version of DB9. Upgrade database schema or create new database schemaThis part ends with "apmdb already exists and is not a valid database."
We are considering to discard the old database and start with a new one from scratch, because they are not using CEM.
But my only question is, can the Team Center draw any data from a historical APM database at all?
Does customer benefit from restoring an older DB assuming they are not using CEM?
Thanks and regards,
You may want to ask this in APM EF or Yammer APM Group as well
Scenario 1 is the one you should be using with the APM DB backup from 9.0
I would suggest to use the dbrestore-postgres.bat script from the 10.1 EM install to restore the backup.
That script should drop the existing database before restoring the backup & finally upgrading the schema with a call to dbupgrade (dbupgrade.bat/sh)
The schematools.log would contain any logged errors.
Correction - the output from dbrestore-postgres.bat(sh) does not go to schematools.log and you need to redirect the standard out & error top capture it e.g.
"... > dbrestore.out 2>&1"
I would avoid scenario 2 as you should not be having to rename 'postgres' superuser to 'wily' etc.
If not using CEM I believe it is only really appmap data the customer would lose so if they don't use it they could start afresh.
Hope this helps
I faced the same scenario 2 when helping a customer and raised a KB for that, please use below document and see if it helps:
If you are upgrading to 10.0:
Appmap tables are missing in the CEMDB Postgres database for APM 10.0.
If you are upgrading to 10.1: