[Fusionforge-commits] r7407 - trunk/gforge/contrib

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 15 11:00:57 CEST 2009


Author: lolando
Date: 2009-04-15 11:00:57 +0200 (Wed, 15 Apr 2009)
New Revision: 7407

Modified:
   trunk/gforge/contrib/migrate-from-gfas.pl
Log:
Migrate FRS packages and releases (not files yet)

Modified: trunk/gforge/contrib/migrate-from-gfas.pl
===================================================================
--- trunk/gforge/contrib/migrate-from-gfas.pl	2009-04-15 09:00:47 UTC (rev 7406)
+++ trunk/gforge/contrib/migrate-from-gfas.pl	2009-04-15 09:00:57 UTC (rev 7407)
@@ -1,5 +1,8 @@
 #! /usr/bin/perl -w
 
+# GForge AS to FusionForge database migration script
+# Copyright 2009, Roland Mas
+
 # GForge AS database is gfas
 # FusionForge will be fusionforge
 
@@ -305,5 +308,35 @@
 	die "Rolling back" ;
 } ;
 
+$map = {
+    'frs_package_id' => 'package_id',
+    'project_id' => 'group_id',
+    'package_name' => 'name',
+    'status_id' => 'status_id',
+    'is_public' => 'is_public',
+} ;
+migrate_with_mapping ('frs_package', 'frs_package', $map) 
+    or do {
+	$dbhFF->rollback ;
+	die "Rolling back" ;
+} ;
+
+$map = {
+    'frs_release_id' => 'release_id',
+    'frs_package_id' => 'package_id',
+    'release_name' => 'name',
+    'release_notes' => 'notes',
+    'changes' => 'changes',
+    'status_id' => 'status_id',
+    'preformatted' => 'preformatted',
+    'extract (epoch from release_date)::integer' => 'release_date',
+    'released_by' => 'released_by',
+} ;
+migrate_with_mapping ('frs_release', 'frs_release', $map, "where status_id != 0")
+    or do {
+	$dbhFF->rollback ;
+	die "Rolling back" ;
+} ;
+
 print STDERR "Migration script completed OK\n" ;
 $dbhFF->commit ; print STDERR "Committed\n" ;




More information about the Fusionforge-commits mailing list