cancel
Showing results for 
Search instead for 
Did you mean: 

Migration from Alfresco Comm. 4.2.c on CentOS to Win2k8x64

therev
Champ in-the-making
Champ in-the-making
Is this even possible?

I've got a dev box running on CentOS, but the powers that be want everything moved to a Windows environment. I'm not TOO far in that I can't start from scratch, but it would be a serious PITA. Is it possible to migrate from the Linux distro to the Windows version?

Is it a PG_DUMPALL, alf_data copy, restore, voila! type of situation or am I heading down a dark… dark road?
1 REPLY 1

therev
Champ in-the-making
Champ in-the-making
So, I found this blog post that describes the upgrade procedure within Linux. It's clear and concise and works (with minor changes) for migrating from CentOS to Windows 2008 x64.

Original Blog:
https://www.fossoffice.com/en/2012/10/31/alfresco-community-upgrade/

Upgrade steps:

- Stop Alfresco server:

root@alftest:~# sh /opt/alfresco-4.2.f/alfresco.sh stop

- Make a complete backup of alfresco installation:
I made a full zip of the /opt/alfresco-4.2.f directory into a zip file

- Turn off indexing inside the old installation (thanks to Loftux from Alfresco forum for the advise):
In /opt/alfresco-4.2.f/tomcat/shared/classes/alfresco-global.properties turn

### Solr indexing ###
index.subsystem.name=solr
dir.keystore=${dir.root}/keystore
solr.port.ssl=8443

into

### Solr indexing ###
index.subsystem.name=noindex
dir.keystore=${dir.root}/keystore
#solr.port.ssl=8443

- Start and stop alfresco server (throw a delay of 5 minutes between the two commands in order for the server to start properly):

root@alftest:~# sh /opt/alfresco-4.2.f/alfresco.sh start && sleep 300 && sh /opt/alfresco-4.2.f/alfresco.sh stop

(the quote above consist of one command)

- Start Alfresco postgresql:

root@alftest:~# sh /opt/alfresco-4.2.f/alfresco.sh start postgresql

- Dump (backup) the entire alfresco postgresql database to a script file. The postgres user password will be asked, use the one that you gave during the Alfresco installation:

root@alftest:~# su postgres
$ cd /opt/alfresco-4.2.f/postgresql/bin/
$ ./pg_dump -h localhost alfresco > /tmp/alfrescodbdump
Password:
$ exit

- Stop Alfresco postgresql:

root@alftest:~# sh /opt/alfresco-4.2.f/alfresco.sh stop

- Install the new Alfresco release on your Windows 2008 machine - make sure you install the same version of Alfresco ont he Windows server as you are migrating from on the Linux box. It is recommended to keep the same Admin Password as in the old one. Do not start Share during installation (answer “no” when asked to). Additionally, set the two Windows services (Tomcat and PostgreSQL) to start MANUALLY.

- Make the essential configurations inside the new installation (e.g. server’s hostname, etc) AND turn indexing off as in the corresponding step above.

- Start new installation’s postgresql:
Start the 'alfrescoPostgreSQL' service on the Windows 2008 server.

- Copy your data and Alfresco dump file
Drag and drop the zip file of the Linux alfresco-4.2.f directory and the alfrescodbdump file to your windows machine. I dropped it into the C:\Temp directory and extracted the zip into C:\Temp\Alf directory

- Allow Trusted DB connections/logins
This will allow you to run postgres commands without having the postgres user's password.
Open your pg_hba.conf file located at C:\Alfresco\alf_data\postgresql
Edit the authentication method so it matches the following:
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust


- Drop new installation’s database, create the new one and restore the above backed up:
Open an elevated cmd prompt
cd C:\Alfresco\postgresql\bin
dropdb alfresco
Database "alfresco" will be permanently removed.
Are you sure? (y/n) y
Password:
createdb -T template0 alfresco
Password:
psql alfresco < c:\Temp\alfrescodbdump
Password:
(…)
ALTER TABLE
ALTER TABLE
REVOKE
REVOKE
GRANT
GRANT
$ exit


- Stop new Alfresco postgresql:
Stop the 'alfrescoPostgreSQL' service on the Windows 2008 server.

- Move content storage to new installation’s storage. You have a backup, remember?…
Drag and drop the contentstore contentstore.deleted directories from C:\Temp\Alf to C:\Alfresco\alf_data

- Start and stop the new alfresco server (again wait for 5 minutes between the two commands for the server to start properly):
Start the 'alfrescoTomcat' service - this should also start the 'alfrescoPostgreSQL' service. Verify both are running and wait 5 minutes before stopping the 'alfrescoTomcat' service. This should also stop the 'alfrescoPostgreSQL' service. Verify both stop.

- Change the PostgreSQL authentication Back
In the above step where you changed the pg_hba.conf back to the following:
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

- Make any modification (in configuration files, etc) to match your installation scheme.

- This is where I do a reboot. Sure, you can just start the services, but why not give the box a clean boot? Wait a couple of minutes for the Tomcat server to sort itself and then login to the new server.


And that's it! If you have any problems, feel free to post a question or hit me up on Twitter: @spidlerc