Forum: open-discussion

Monitor Forum | Start New Thread Start New Thread
RE: Simple HowTo for Migration of gforge-as 2008 to fusionforge [ Reply ]
By: Seth Galitzer on 2014-06-09 22:25
This looks like a pretty clean way to migrate the database. I've been trying to patch the gfas-update script to go straight to latest fusionforge. Your method is probably a bit more sane. I do have some useful patches for the gfas-update that will handle sensible migration of disk files, including preservation of permissions. I will try to post those tomorrow. I have another script that migrates SCM data, which I will also post. The only catch with SCM is that end users will need to update their local copies so they point to the new server.

Simple HowTo for Migration of gforge-as 2008 to fusionforge [ Reply ]
By: Peter Katzmann on 2014-06-06 14:28
[forum:717] (22) downloads
attached is a tarfile with my migration script and intermediate empty database.
The database is need because to conversion runs at first against this structure

So you need at best a vm with a postgres server installed with the intermediate db.
I will describe the process in a way that there are 3 machines involved, the old gforge production server, the migration vm and a completely installed new system.
My company, edag engeneering ag, invested a fast amount of time for this.
Wikis are not converted and your mileage will vary. If you are not familiar with db installation you will run into trouble.
Use it at your own risk, i'm not liable for any damage.

Steps to reproduce (not for the faint hearted):
#got to production server:
pg_dump -U postgres -C gforge5 --encoding utf8 > /tmp/gforge5.dump
cd /var/lib/gforge/filesystem/
chmod -R ugo+rw *

#on forge vm:
su postgres
psql -U postgres
drop database gforge;
drop database gfas;
create database gforge template gforge511empty owner gforge;

#mount forge/filesystem/ form production server to vm in /mnt
rm -r /tmp/filesystem
cp -a /mnt /tmp/filesystem
sudo umount /mnt
sudo chown -R <your user>:users /tmp/filesystem

su postgres
cd /tmp

copy dump file from production:
scp root@forge-production:/tmp/gforge5.dump .
iconv -f UTF-8 -t utf-8//IGNORE < gforge5.dump > gforge5-fix.dump

psql -U postgres < /tmp/gforge5-fix.dump
psql -U postgres
alter database gforge5 rename to gfas;

export DB_PW='gforge'

Check if gfas update commits everything

su postgres
pg_dump -U postgres -C -O gforge > /tmp/fforge.dump

scp /tmp/fforge.dump root@new-gforge-server:/tmp

now on new server:

psql -U postgres
drop database gforge;
create database gforge;
grant ALL ON DATABASE gforge TO gforge;
psql -U gforge -d gforge < /tmp/fforge.dump

#should now e included in duno file
##cd /usr/share/gforge
##psql -U gforge -d gforge < plugins/scmhook/db/scmhook-init.sql

# for db upgrade datei vi common/include/ bebreiten wg. leere pfade