Sunday 11 August 2013

The Linux Alfresco Restore Script

For a few who wanted the equivalent restore script to the backup script Here it is. Tried and tested.

#!/bin/bash
e cho "=== Set up the environment ==="

Alfresco_root="/opt/alfresco-4.2.c";
Alfresco_repository="$Alfresco_root/alf_data/";
Alfresco_backup_dir="/home/philip/backup/";
DB_USER="postgres";
alfresco_db="alfresco";

echo "=== Stopping Alfresco ==="

sh $Alfresco_root/alfresco.sh stop
sleep 240

cd $Alfresco_root/tomcat/shared/classes

echo "=== copying the global properties file ==="
cp alfresco-global.properties.noindex alfresco-global.properties


echo "===  Alfresco stopped... ==="
echo "=== Starting Alfresco in Postgres only mode ==="

sh $Alfresco_root/alfresco.sh start postgresql


echo "=== Starting to restore the database ==="


dropdb -U $DB_USER  $alfresco_db -h localhost
createdb -U $DB_USER -T template0 $alfresco_db -h localhost


psql -h localhost -U $DB_USER  $alfresco_db < $Alfresco_backup_dir/alfrescodbdump*


sh $Alfresco_root/alfresco.sh stop postgresql

echo "=== Postgres is stopped Ready to copy over the database ==="

cd $Alfresco_root/alf_data
rm -rf contentstore
rm-rf contentstore.deleted
cp -r $Alfresco_backup_dir/alfresco-4.2.c.backup*/alf_data/contentstore  $Alfresco_root/alf_data/contentstore
cp -r $Alfresco_backup_dir/alfresco-4.2.c.backup*/alf_data/contentstore.deleted $Alfresco_root/alf_data/contentstore.deleted

echo "=== Put the global properties file back ==="

cd $Alfresco_root/tomcat/shared/classes
cp alfresco-global.properties.solr alfresco-global.properties

echo "=== Set up indexing ==="
rm -rf $Alfresco_root/alf_data/solr/workspace/SpacesStore
rm -rf $Alfresco_root/alf_data/solr/archive/SpacesStore
rm -rf $Alfresco_root/alf_data/solr/workspace-SpacesStore/alfrescoModels
rm -rf $Alfresco_root/alf_data/solr/archive-SpacesStore/alfrescoModels

echo "=== Restart Alfresco Building indices ==="

cd $Alfresco_root

sh $Alfresco_root/alfresco.sh start

Friday 9 August 2013

Interesting restore problem with Alfresco

I am running Alfresco 4.2.c Community Edition on two servers. The main server and a development server. Occasionally I take the image from the main machine and restore it to the development machine.
This time when I did it my restore script remade the postgres database then copied the new contentstore over the old one. I remade the index and promptly received an internal server error once I had successfully logged in.
I stopped Alfresco.
I manually copied the files over from the backup contentstore to the live one in Alfresco and then deleted the index files as before and remade the index. It worked perfectly.
So what was the difference between using command line and manually using Dolphin?
I may try to delete the directory before copying over.
I suppose it is another mystery to solve.

Wednesday 7 August 2013

Weird Problems with Moodle 2.5.1

I have a client using Moodle. We have just upgraded to the latest version 2.5.1 and a puzzling problem has appeared.

The upgrade went fine and on the console everything works as it should.

Now this tells me that everything is really OK and this is not a Moodle problem. When we access the Moodle from any other machine we are unable to upload a file because we don't get the upload screen. ( as in the image) It just sits there with a timer sitting there on the screen. On slow servers (when the machine is loaded) we see this for a few seconds before the screens load, but in this case that's as far as it gets. Its not the browser as we have looked at several and we have tried accessing the server in different ways on different networks.

The problem is more interesting that a previous version of Moodle 2.4.3 also runs on the same virtual machine (Windows 2008R2) and network and surprisingly that works fine. No errors. But three different implementations of Moodle 2.5.1 on three different virtual servers all fail in the same way. When they had the previous version of Moodle (2.4.3) they too worked OK.

So it appears that the network is ok and the firewall antivirus etc, otherwise the Moodle 2.4.3 using the same mechanism would fail, but the latest version of Moodle on three different machines have the same symptoms and that points to a network issue. So far I have have no response on the Moodle forums and I have had no luck trying to reproduce this problem on my home server network using largely the same software.
No else seems to have the same problem.

I guess that the daily build on Moodle might help to upgrade again.

So it must be Moodle, but its a puzzle that yet has to be solved.