HELP! Migration, Clean Instance with Old Data

HELP! Migration, Clean Instance with Old Data

by Sean Wing -
Number of replies: 3

This post follows several sleepless nights due to a failed migration from an existing Windows 3.x instance to a Linux 3.4 instance.

I have had to create a clean 3.4 instance. I have copied in the moodledata folder, and I have imported the database into mySQL.

All of the relevant data shows in the database (courses, users, etc).

However, when I attempt to load the site, it runs the installer, and subsequently, all of the data is overwritten or disappears, and the Moodle instance works beautifully, except it is missing my theme and all of the courses and users.

Any clues? Is there a toggle I can use to prevent Moodle re-creating the database?


Sean

Average of ratings: -
In reply to Sean Wing

Re: HELP! Migration, Clean Instance with Old Data

by A. Obeid -

Hi Sean,

you have to create the config.php file on the new moodle. Maybe you copy the old one and set the $CFG->dbhost= 'host of the new DB' ,dbname,   dbuser, dbpass and the path to the new moodledata in dataroot.

For your theme also you have to copy the folder from oldmoodle/theme/yourthemeto the new moodle/theme/

In reply to A. Obeid

Re: HELP! Migration, Clean Instance with Old Data

by Sean Wing -
Hi Obeid and Howard



Thanks for your response.



I have been able to rectify this issue.



There was an inconsistency with the table prefixes which I did not pickup

initially. I dropped all the tables and re-imported, with the correct

prefix.

I then purged the cache and the website is now fully functional



Thanks everyone for prompt support over last 24h



On Wed, Feb 21, 2018 at 6:30 PM, A. Obeid (via Moodle.org) <
In reply to Sean Wing

Re: HELP! Migration, Clean Instance with Old Data

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

You just can't do that. 

You can't create a clean instance and then somehow import an older database over the top. It isn't a clean instance any more. It's most likely a corrupted database. 

If you can create a clean instance of 3.4 then you know 3.4 will run. In that case you know you can upgrade an older version of Moodle. You can't upgrade <3.0 data directly to 3.4 however. You need to go via 3.0