cancel
Showing results for 
Search instead for 
Did you mean: 

Database Restore

patrick_windsor
Champ in-the-making
Champ in-the-making

Hello, I had a harware failure and lost my Alfreso server. I do have a copy of the Alfresco install directory, database and contentstore. What I am struggeling with is how do I restore the database. I do not have a traditional backup of the database, just a copy of all of the directories for the alfresco install (everything was on one server). I have instructions to restore the database from one that was backed up. Is there a way to restore from the files I have?

3 REPLIES 3

jljwoznica
Star Collaborator
Star Collaborator

The Content Store contains the physical files uploaded to the Repository.  To restore the backup successfully, the contentstore directory and database must be backed up as a set. When you restore an Alfresco backup, you must restore both the Alfresco database and the dir.root directory (contentstore directory) from the same backup set. Otherwise, the repository may be corrupted.

When I performed the backup I stopped all of the Alfresco services and then copied the Alfresco directory and the contentstore directory. I reinstalled Alfresco on a new machine and have the ablity to resore the contentstore, but what I cannot locate is the DB files, I cannot determine where they are stored. Essentially my question is for a standard Alfresco Community Edition, what directory is the database in? I was hopong to copy those files into my new install )as well as my content store) and then start the services.

Assuming you've used the Community 5.2 installer, your backup includes postgres binaries and a postgres database. Which OS you're running on? Please check the start / stop scripts how to set the environment and then use command-line tools to create a correct database dump that can be restored to the new installation.
I recommend not to use the postgres binaries shiped with Alfresco on the new install. Instead use supported installs for your OS (e.g. from your linux distribution package manager). You should always create real db backups/dumps instead of just folder copies.
As long as you created cold backups chances are high to get everything restored. It's a pitty that Alfresco doesn't ship with a working backup & restore mechanism.

Take a look to this thread how to run pg_dump and restore on linux setup created by the Alfresco installer.