Moodle 2.5.1 Migration

Moodle 2.5.1 Migration

by Aaron Alcock -
Number of replies: 3

Have migrated Moodle to new server and attempted to adjust all url references with new name (changed name from moodle to moodlehigh) and receive this error:

 

Search and replace text throughout the whole database


UPDATE {3} SET username = REPLACE(username, ?, ?) [array ( 0 => 'moodle.domainname.com.au', 1 => 'moodlehigh.domainname.com.au', )]

Error writing to database

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3} SET username = REPLACE(username, 'moodle.domainname.com.au', 'moodlehigh.do' at line 1

UPDATE {3} SET username = REPLACE(username, ?, ?)
[array (
0 => 'moodle.domainname.com.au',
1 => 'moodlehigh.domainname.com.au'',
)]
Error code: dmlwriteexception
Stack trace:
  • line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 895 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 6787 of /lib/adminlib.php: call to mysqli_native_moodle_database->execute()
  • line 74 of /admin/tool/replace/index.php: call to db_replace()

 

Any Ideas?

Average of ratings: -
In reply to Aaron Alcock

Re: Moodle 2.5.1 Migration

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Why do you have a table in your database called '3'?

The replace function is a bit crude. It simply grabs all the tables in the database - skips a few particularly ones that have been 'blacklisted' - and then runs the above statement for every text field. 

I would check your database for strangely named tables. 

Average of ratings: Useful (1)
In reply to Aaron Alcock

Re: Moodle 2.5.1 Migration

by Luz Mendoza -

Hi Aaron,

Sorry to bother you but would you be so kind to guide me on how to migrate Moodle to a server. Well To be more specific I had my Moodle installed in a private local server and now the company I work has giving me access to a dedicated server at Go daddy and well my task is now move/migrate Moodle that is currently working. I do not want to create a new One from scratch I simply want to migrate the one we have which is fully working. I will greatly appreciate your help.

Luz