How to drop the internal database tables before a restore from backup

When restoring a backup from TC using "maintainDB.cmd restore -F some_path\" you get the error: "Cannot proceed with 'restore' command: Target database is not empty."
I use the internal database and I do not know how to drop the tables.

I found that I could solve this by removing the 'system' and 'config' directories from the buildserver directory before restore but what is the recommended way to make sure you start with an empty internal database before a restore.


Comment actions Permalink

Hi Tim

Yes, deleting the database files and current content of config and system folders is the best way. MaintainDB tool will recreate database from scratch, and populate in by all the data.
But make sure

  • Your backups include build logs and personal changes
  • system/artifacts folder is not included in backups, so should be preserved

See more details at Backing up Data.

We bundle HSQLDB to streamline evaluation process, but this database engine is not reliable enough for usage at production servers. It's often becomes corrupted with no simple recovery procedure - you have to revert the server from backups.
Please take a look at Migrating to an External Database page.


Comment actions Permalink

Thanks for your answer. It is good to know that what we do is indeed the right procedure.

With regard to using the internal database. I've read al the warnings but we haven't seen a clear description of what will be handled OK and what won't. So far we are running without any problems and the installation of a database adds a considerable maintenance effort. We have more or less decided to not change it unless it is broken and we are running for more than 6 months without problems. We auto clean a lot and leave hardly anything behind older than 2 weeks so the database will not grow much so we still hope to be able to run without the 'real' database.

We do not depend on build history much, only the configuration settings are critical to us.

I know we are walking the edge but your product is just too good, even in 'demo mode' :-)


Please sign in to leave a comment.