Icons and videos are broken after migrating Moodle to a new server.

Icons and videos are broken after migrating Moodle to a new server.

Ярослав Яковенко -
回帖数:9

Hello!

My task is to move Moodle to a new server (with WordPress installed on it).

I've copied the following folders:

1. "moodle" to "public_html"

2. "moodledata" to "private_html".

3. Then I edited paths in config.php and pasted moodle tables to the Wordpress database (WP and Moodle tables now in one Database).

Everything works fine but the icons and videos are being broken or doesn't load at all.


For example, please see links below:

Old server:

https://tuprofe.com.ua/moodle/pluginfile.php/27/mod_lesson/page_contents/49/fax-1889009_640.jpg

New server:
http://wordpress-391374-1522386.cloudwaysapps.com/moodle/pluginfile.php/27/mod_lesson/page_contents/49/fax-1889009_640.jpg

Actually, I don't understand how pluginfile.php works and why I can't find .jpg and video files in the "moodle" folder (but the path to them shows in the browser). 

Please help me to figure it out and to fix this problem. 

P.S. - .pdf files are also broken. 


Yaroslav.


 



回复Ярослав Яковенко

Re: Icons and videos are broken after migrating Moodle to a new server.

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Most likely you've missed this step: https://docs.moodle.org/en/Moodle_migration#Update_links_containing_wwwroot_in_the_database.

That said, you've gone through an unusual path as compared to the official method https://docs.moodle.org/en/Moodle_migration making WordPress and Moodle to share the same database. Do you really have only one database? The two applications are too close for my taste. 眨眼

BTW, this is not a developer question, something for the Installing and upgrading forum.
回复Visvanath Ratnaweera

Re: Icons and videos are broken after migrating Moodle to a new server.

Ярослав Яковенко -
Thanks for your reply!

Unfortunately, this didn't help.

Maybe there is another solution. Let me describe what I have to achieve. In general - I have to change the Joomla site to WordPress site but keep the Moodle site inside.

My client has a website located on domain tuprofe.com.ua (built with Joomla). Please see the screenshot of the root:

https://ibb.co/166qvYB

"moodle" folder sits inside "tuprofe.com.ua" folder. https://tuprofe.com.ua/moodle/

I made a completely new site with WordPress and now I need to change the old Joomla site to the new WP site keeping Moodle.

Despite I don't need to change server and domain it seems that I cannot switch Joomla to WP without deleting Moodle (and then restoring it above the newly installed WordPress site).

So firstly I've tried to migrate the Moodle site to the test server, but as I described above I had problems with icons, pdfs, and videos (updating links doesn't help).

Now I think is there any other way to install WordPress instead of Joomla, then move moodle and moodledata folders to their right places, delete all Joomla folders and files via SFTP?

The client's' server plan doesn't support SSH, so I have to use SFTP.

Please help, I really struggle with this problem 伤心
回复Ярослав Яковенко

Re: Icons and videos are broken after migrating Moodle to a new server.

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
> Unfortunately, this didn't help.

Thas is not helpful. What did you do exactly? What was the result?

> I have to change the Joomla site to WordPress site but keep the Moodle site inside.

How was it done earlier?

> "moodle" folder sits inside "[example.com]" folder. https://[example.com]/moodle/

That is a possible solution. Did you read https://docs.moodle.org/en/Moodle_migration carefully, for example https://docs.moodle.org/en/Moodle_migration#Update_config.php_with_the_URL_of_the_new_server ?
回复Visvanath Ratnaweera

Re: Icons and videos are broken after migrating Moodle to a new server.

Ярослав Яковенко -

I've just tried again. I've done everything accordingly to this instruction (this time I've created a separate DB for _mdl tables):

https://docs.moodle.org/en/Moodle_migration


I've updated config.php file with new DB login credentials and changed this:

$CFG->wwwroot   = 'https://tuprofe.com.ua/moodle';

$CFG->dataroot  = '/var/www/tuprofe/moodledata';

$CFG->admin     = 'admin';

to this:

$CFG->wwwroot   = 'http://wordpress-391374-1536250.cloudwaysapps.com/moodle';

$CFG->dataroot  = '/home/master/applications/kvrtyddyhk/private_html/moodledata';

$CFG->admin     = 'admin';


Then I used Search and replace tool and changed 

https://tuprofe.com.ua/ 

to 

http://wordpress-391374-1536250.cloudwaysapps.com/


Still have the same issues:

https://ibb.co/dJKMcqh



回复Ярослав Яковенко

Re: Icons and videos are broken after migrating Moodle to a new server.

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
Everything looks good this time. Could you get the URL of the broken picture (in the HTML source view) and post here? Also try Site administration > Development > Purge all caches. Sometihmes even purging the browser cache helps. You must have tried other browsers and other devices. Also try chaning Site administration > Server > HTTP - Use slash arguments.
回复Visvanath Ratnaweera

Re: Icons and videos are broken after migrating Moodle to a new server.

Ярослав Яковенко -
I've just noticed that some menu elements don't work.
https://ibb.co/KsSLBHw

Here is the link to the broken image:

And the screenshot of the Console:
https://ibb.co/d4T2wBX

"Also try Site administration > Development > Purge all caches. Sometihmes even purging the browser cache helps. You must have tried other browsers and other devices. Also try chaning Site administration > Server > HTTP - Use slash arguments." - I've tried these but nothing helped 伤心
回复Ярослав Яковенко

Re: Icons and videos are broken after migrating Moodle to a new server.

Visvanath Ratnaweera -
Particularly helpful Moodlers的头像 Translators的头像
If those 404 errors correspond to images, the web server can't access them in ./moodledata/filedir. Check file permissions.
回复Visvanath Ratnaweera

Re: Icons and videos are broken after migrating Moodle to a new server.

Helen Foster -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 Translators的头像

Thanks Visvanath, moving this discussion to the Installing and upgrading forum as suggested, so no need for you to re-post Yaroslav.