Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -
Number of replies: 13

Hi all,

I've been using Moodle 3.0.4 from last one year and now I wanted to upgrade it to version 3.2. But, I want to test the 3.2 version under new site before trying an upgrade on my old site.

So far I've done copies of 3.0.4 moodle data, code and database and installed 3.2 under new website.

I need some advice on how to proceed further without many hiccups. And hoping someone here had already been in my position and know some do's and do not's that I need to take care of.

Please, any brief step by step guide would be highly appreciatable. 

Thank you,

Dee

Average of ratings: -
In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

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

This is a very good idea. 

Your starting point is to duplicate your current course. This is exactly the same thing as 'migrating' the course (except the original course keeps running). So, see Moodle_migration as a starting point. Any questions, just ask. 

Also, make sure you have good backups before you do anything. That's your protection against any mistakes. 

In reply to Howard Miller

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

Hi Howard,

Thanks for the reply. As you pointed migration methods is what I'm looking for with an exception of leaving the old site as it is until I'm happy with the 3.2.

I'm not gonna modify any part of my old site apart from just copying the directories to a different location appropriate to my new site. So this means I'm confident that my backups are safe and moreover I do have the GoDaddy auto backups for last 7 days.

What's confusing me is the new moodle folder structure as it looks slightly different than old one. So thought I would share with you and get some confirmation before moving to new site folder. Also, the interesting thing is the new 3.2 moodle at the time of installation is not allowing me to choose the data folder directory within the main moodle directory.It keeps telling me its not secure and on other note I've the moodle data folder within the main moodle directory for my old site.

Please have a look at these pics below which I had both the old and new folder structures and let me which folders to copy.


Thanks again,

Dee

In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

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

Your new site data folder is missing a load of stuff. The important one is 'filedir'. If you copied one from the other, why would it be different?

In reply to Howard Miller

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

Sorry, I think you misunderstood me. I still haven't copied anything from the old site and only asked you to confirm the folder structure as I slightly doubted new moodle structure.

Could you please confirm the folders that I need to copy.  

Also, do I've to copy and replace or delete specific folders and copy?.

Thanks

In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Ok, so normally your data is not kept inside your Moodle folder as you have seen in the warning.  For a duplication you need to copy your entire data folder over to the new site, the config.php file so that your database connects correctly, your database and then the plugin folders.  

My way of upgrading, duplicating etc is to download new code, then I open up my site and go to plugins page, filter to additional and then work down the list to make sure I get all the plugin stuff copied over.  I have about 40 currently so I need the list!!  

In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It sounds like you are pretty close with the duplication process.  Now, you need to copy over any plugins that you have installed and your config.php file.  Then, you need to change the ip address in the config file to reflect the accurate location of the duplicated site.  Then, go through the upgrade process (point your browser towards you localhost).  Once that is complete, navigate to yoursite/admin/tools/replace/index.php and update the database with your new ip address or dns name.  

In reply to Emma Richardson

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

Hi Emma,

Thanks for the reply. I forgot the plugins and it's a good point to be remembered.  I hardly remember which ones I used and mostly 1 or 2 and that's it.

Coming to changing IP address, I'm hosting my site on Godaddy and think I need to change the URL?.

Also, when you mean replace the IP/DNS name in index.php, does it update all the URLs in the database?


In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Yes, change the url.  Wasn't sure where you were hosting.  Changing it in the config.php gets it working.  Using the replace tool I mentioned updates the database so that your images etc link correctly.

In reply to Emma Richardson

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

Hi Emma,

Sorry for the late reply as I got busy with other important stuff. Thanks to you and Howard for all the valuable advice. I finally had time to upgrade and the process went smoothly apart from one issue where the old code for bootstrap elements embed video wasn't working as it should in the  3.2.1 moodle. So I tried a couple of workarounds and finally able to fix it but now its time to figure out an easy way to do it for all the videos (over 50) in one go.  Because editing bootstrap elements for each and every video is a real pain.

Below is the old and new code which I need to update for all the videos.

old 3.0.4 moodle

<pre style="text-align: center;"><a href="http://321.example.com/draftfile.php/5/user/draft/90663098/video.mp4">Video.mp4</a><br></pre>

new 3.2.1 moodle

<video width="480" height="360" controls="true"><source src="http://321.example.com/draftfile.php/5/user/draft/391953371/Video.mp4">http://321.example.com/draftfile.php/5/user/draft/391953371/Video.mp4</video>

Could you please guide me the safest way to do this.

Thanks again

Dee

In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Was this an add-in?  If you used core moodle to insert the video, you should not have to do this.  Perhaps a theme issue?  Did you upgrade all your plugins?

I can't think of an easy way but I imagine you might be able to write a script that would look for the Video.mp4 and update it.  Why do you have to have to change the Text showing to the full url though - that makes no sense to me...

 

 

In reply to Emma Richardson

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

Well, you might be right coz I thought the same as both the Klass theme and bootstrap elements plugin(https://moodle.org/plugins/mod_bootstrapelements) doesn't have 3.2.1 compatible version.But the theme works perfect without any misalignments or errors.

Why do you have to have to change the Text showing to the full url though - that makes no sense to me...

Sorry, I didn't quite understand what you mean. Did you mean the "example.com" which I used above?. I used it because the site I'm working now has got user permissions for courses and is in maintenance mode and thought its not necessary to share unless someone really needs to check. 

In reply to Dee K

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
<video width="480" height="360" controls="true"><source src="http://321.example.com/draftfile.php/5/user/draft/391953371/Video.mp4"></video>

This part - is that just creating the text for the link? Not sure why you need this twice?
In reply to Emma Richardson

Re: Make a copy of old Moodle 3.0.4 site under new Moodle 3.2 site ?

by Dee K -

I see, got it now. Basically, I didn't include that part as the plugin automatically creates it while it gives me an option to either copy the video file/make an alias link to the video, in which I choose the latter and think that's putting the link.

But I agree with you as it is not gonna make a difference and rather it makes no sense to use. I'll fix it anyway.

Thanks again.