As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
I set up a development server to experiment with Alfresco Community Edition. Everything seems to be working well so I have begun experimenting with being able to backup and restore the system to another machine. This seems to work well with one exception, the files are not indexed after being restored. I can post the script I have created to backup and restore my system if that would be of help. I look forward to hearing any advise anyone can provide. Thank you in advance.
Hi:
Depending on how you do backups, you should have a copy of the current SOLR indices, or at least you will be able to recover the daily backups of SOLR from $ALF_HOME/alf_data/solr4Backup
Check the following links for more information (some scripts and backup strategies are commented there):
Alfresco Backup and Disaster Recovery White Paper
GitHub - toniblyx/alfrescodevcon2018: Slide deck for my talk about Alfresco Backup and DR (and HA architectures)
Regards.
--C.
Do you mean that all files aren't indexed (no index/search at all) or only files created after the restore? Are you running on Linux or Windows?
After the backup is complete the files are all restored properly except that the search features fails to find any files on the system that match the search criteria. New files added to the system after the restore are searchable but not the old files that have been restored. Also, I just found out this morning that if I move the restored files from one folder to another they become searchable. I'm going to post the backup and restore instructions I have created for myself.
Here is the backup instruction I have created for myself:
Stop the Alfresco Community Edition server
cd /opt/alfresco-community/ sudo ./alfresco.sh stop
Export the database to alf_data
sudo ./alfresco.sh start postgresqlsudo supostgresql/bin/pg_dump -U alfresco -F t -b alfresco > alf_data/postgres.dump.tarexitsudo ./alfresco.sh stop
Copy the configuration directory to alf_data
sudo cp -r tomcat/shared/classes/alfresco/extension alf_data
Back up alf_data
sudo rsync -a alf_data/ /path/to/backup/directory
Start the Alfresco Community Edition server
sudo ./alfresco.sh start
And here are the restore instruction I have written for myself:Install a compatible Alfresco Community Edition server and make sure the new server is not running.
cd /opt/alfresco-community/sudo ./alfresco.sh stop
cd /opt/alfresco-community/
sudo ./alfresco.sh stop
Restore the archive to alf_data
sudo rsync -a /path/to/backup/directory/ alf_data/
Restore the configuration directory
sudo cp -r alf_data/extension tomcat/shared/classes/alfresco
Restore the database
sudo ./alfresco.sh start postgresqlsudo su - postgres/opt/alfresco-community/postgresql/bin/psqldrop database alfresco;create database alfresco with owner alfresco;\q/opt/alfresco-community/postgresql/bin/pg_restore -d alfresco < /opt/alfresco-community/alf_data/postgres.dump.tarexit
...did you stop alfresco, Solr and DB (source side) before backing up?
Do you have some hardlinks under alf_data ?
if not, and it's no problem to reindex all data: stop your "clone", delete the index data dirs () under ...alf_data/solr4/index
or remove the index data und copy/move a snapshot form ...alf_data/solr4Backup to your index data dirs.
As in: Restoring Solr 4 indexes | Alfresco Documentation
Just a dumb question (yes, I have seen rsync -a 😞 after restoring to the new machine. Is the alfresco user the same as on the source instance (name, UID, GID)? Ownership and accessrights are ok?
Yes, as far as I can tell all of the owner and group information is preserved is the -a option. When I "ls -la" the alf_data directory, for example, everything belongs to the root user and group except the postgresql directory that is owned by postgres but in the root group.
..ah.. you run alfresco as root user - ok, there should be no problem with the access rights then.
It seems that your Solr didn't pick up your index files right. Can you see something in catalina.out on startup?
You should take care with the way you restored the extension folder, as there are files in there, like share-custom-config.xml and alfresco-global.properties that have adresses/hostnames/IPs in them, if you blindly copy them, you can make your restored server to connect into the original one.
For thoses cases, you better to recover the content, avoiding this kind of problem.
To mitigate problems with these properties dependant of your environment, you may include them in your startup scripts as part of JAVA_OPTS (ex. -Dalfresco.host=xxx). And so the essential config under shared (at least for alfresco-global.properties) is the same for every environment and so, in a backup env too.