Permalink
Browse files

UTF8 migration - now supporting PostgreSQL

  • Loading branch information...
patrickslee
patrickslee committed Mar 10, 2006
1 parent 6442124 commit cb8229d0a80b1d1901ccec3f72b2ff161aa815d6
View
@@ -316,6 +316,13 @@
print_simple_box_start('center', '100%', '', 20);
print_heading($stradministration);
+/// Deprecated database! Warning!!
+ if (!empty($CFG->migrated_to_new_db)) {
+ print_simple_box_start('center','50%');
+ print_string('dbmigrationdeprecateddb','admin');
+ print_simple_box_end();
+ }
+
if (!empty($CFG->upgrade)) { // Print notice about extra upgrading that needs to be done
print_simple_box(get_string("upgrade$CFG->upgrade", "admin",
"$CFG->wwwroot/$CFG->admin/upgrade$CFG->upgrade.php"), "center", '50%');
View
@@ -0,0 +1,54 @@
+<?php
+ if (!isset($form->dbhost)) {
+ $form->dbhost = '';
+ }
+ if (!isset($form->dbname)) {
+ $form->dbname = '';
+ }
+ if (!isset($form->dbuser)) {
+ $form->dbuser = '';
+ }
+ if (!isset($form->dbpass)) {
+ $form->dbpass = '';
+ }
+ if (!isset($form->dbcluster)) {
+ $form->dbcluster = '';
+ }
+?>
+<form name="migratefrom" action="utfdbmigrate.php" method="POST">
+<input name="migrate" type="hidden" value="1" />
+<input name="sesskey" type="hidden" value="<?php echo sesskey() ?>" />
+<?php if (isset($err["dbconnect"])) formerr($err["dbconnect"]); ?>
+<table cellpadding="9" cellspacing="0" >
+<tr valign="top">
+ <td align="right"><?php print_string("dbhost", "install") ?>:</td>
+ <td><input type="text" name="dbhost" value="<?php p($form->dbhost) ?>" />
+ </td>
+</tr>
+<tr valign="top">
+ <td align="right"><?php print_string("database", "install") ?>:</td>
+ <td><input type="text" name="dbname" value="<?php p($form->dbname) ?>" />
+ </td>
+</tr>
+<tr valign="top">
+ <td align="right"><?php print_string("user") ?>:</td>
+ <td><input type="text" name="dbuser" value="<?php p($form->dbuser) ?>" />
+ </td>
+</tr>
+<tr valign="top">
+ <td align="right"><?php print_string("password") ?>:</td>
+ <td><input type="text" name="dbpass" value="<?php p($form->dbpass) ?>" />
+ </td>
+</tr>
+<tr valign="top">
+ <td align="right"><?php print_string("pgcluster", "admin") ?>:</td>
+ <td><input type="text" name="dbcluster" value="<?php p($form->dbcluster) ?>" />
+ <br />
+ <?php print_string("pgclusterdescription", "admin") ?>
+ </td>
+</tr>
+</table>
+<center>
+<input type="submit" value="<?php print_string('continue') ?>"/>
+&nbsp;<input type="button" value="<?php print_string('cancel') ?>" onclick="javascript:history.go(-1)" />
+</center>
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -33,7 +33,7 @@ function migrate2utf8_backup_ids_info($recordid){
$newbackupids = new object;
$newbackupids->id = $recordid;
$newbackupids->info = $result;
- update_record('backup_ids',$newbackupids);
+ migrate2utf8_update_record('backup_ids',$newbackupids);
}
/// And finally, just return the converted field
return $result;
@@ -31,7 +31,7 @@ function migrate2utf8_block_instance_configdata($recordid){
$blockinstance->configdata = base64_encode(serialize($blah));
- update_record('block_instance',$blockinstance);
+ migrate2utf8_update_record('block_instance',$blockinstance);
return $blah;
@@ -57,7 +57,7 @@ function migrate2utf8_block_instance_configdata($recordid){
$blockinstance->configdata = base64_encode(serialize($blah));
- update_record('block_instance',$blockinstance);
+ migrate2utf8_update_record('block_instance',$blockinstance);
return $blah;
@@ -33,7 +33,7 @@ function migrate2utf8_block_rss_client_title($recordid){
$newrssclient = new object;
$newrssclient->id = $recordid;
$newrssclient->title = $result;
- update_record('block_rss_client',$newrssclient);
+ migrate2utf8_update_record('block_rss_client',$newrssclient);
}
/// And finally, just return the converted field
return $result;
@@ -83,7 +83,7 @@ function migrate2utf8_block_rss_client_preferredtitle($recordid){
$newrssclient = new object;
$newrssclient->id = $recordid;
$newrssclient->preferredtitle = $result;
- update_record('block_rss_client',$newrssclient);
+ migrate2utf8_update_record('block_rss_client',$newrssclient);
/// And finally, just return the converted field
}
return $result;
@@ -132,7 +132,7 @@ function migrate2utf8_block_rss_client_description($recordid){
$newrssclient = new object;
$newrssclient->id = $recordid;
$newrssclient->description = $result;
- update_record('block_rss_client',$newrssclient);
+ migrate2utf8_update_record('block_rss_client',$newrssclient);
}
/// And finally, just return the converted field
return $result;
View
@@ -128,8 +128,13 @@
$string['confirminstall'] = 'You are about to install language pack ($a), are you sure?';
$string['cronwarning'] = 'The <a href=\"cron.php\">cron.php maintenance script</a> has not been run for at least 24 hours. <br />The <a href=\"../doc/?frame=install.html&amp;sub=cron\">installation documentation</a> explains how you can automate this.';
$string['dbmigrate'] = 'Moodle Database Migration';
+$string['dbmigrationdeprecateddb'] = '<font color=\"#ff0000\">This database is migrated to a new UTF8 database and deprecated. Please edit your config.php and use the new database for this moodle.</font>';
+$string['dbmigrationdupfailed'] = 'Database duplication failed with possible error:<font color=\"#ff0000\"><pre>$a</pre></font>';
$string['dbmigratewarning'] = 'Please make sure that you have backed up your moodle database before commencing this procedure. If you are unsure of how to do that, please contact your system admin. Your Moodle site will be put under maintenance mode after you start the migration process';
$string['dbmigratewarning2'] = '<b>Warning: You are about to start the database migration process. Please be very sure that your entire Moodle database is backed up.</b>';
+$string['dbmigrateconnecerror'] = 'Could not connect to the database specified.';
+$string['dbmigrateencodingerror'] = 'The database specified has encoding $a rather than required UNICODE/UTF8.<br />Please specify another.';
+$string['dbmigratepostgres'] = 'It seems that you are using PostgreSQL as the database server. To continue the migration process you need to manually create a new database with encoding \"UNICODE\"(PostgreSQL 7) or \"UTF8\" (PostgreSQL 8) to store the migrated data. Please enter your new database connection settings below to continue:';
$string['density'] = 'Density';
$string['download'] = 'Download';
$string['edithelpdocs'] = 'Edit help documents';
@@ -195,6 +200,12 @@
$string['pathconvert'] = 'Path of <i>convert</i> binary';
$string['pathlatex'] = 'Path of <i>latex</i> binary';
$string['pleaseregister'] = 'Please register your site to remove this button';
+$string['pgcluster'] = 'PostgreSQL Cluster';
+$string['pgclusterdescription'] = '<pre>PostgreSQL version/cluster parameter
+for command line operations.
+If you only have one postgresql
+on your system or you are not
+sure what this is, leave this blank.</pre>';
$string['remotelangnotavailable'] = 'Because Moodle can not connect to download.moodle.org, we are unable to do language pack installation automatically. Please download the appropriate zip file(s) from the list below, copy them to your $a directory and unzip them manually.';
$string['sitelangchanged'] = 'Site language setting changed successfully';
$string['sitemaintenance'] = 'The site is undergoing maintenance and is currently not available';
Oops, something went wrong.

0 comments on commit cb8229d

Please sign in to comment.