Installing moodle on a home PC then transfer to server

Installing moodle on a home PC then transfer to server

by Diskreet Baric -
Number of replies: 20

Hello, I am fairly new to this so I ask here for help.

I'm trying to install the Moodle XAMPP onto my PC then transfer it to a server so it can be accessed from the internet and not be local based. I managed to install it and set up a test but don't know how to transfer it and the instructions I found on the web a vague and confusing.

Average of ratings: -
In reply to Diskreet Baric

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

What URL are you using to access XAMPP on your PC?

Please provide url's to instructions found.

XAMPP on a PC should be considered for development and not for building a Moodle to be transferred to a web server for public use.   Backups of courses from XAMPP to a public Moodle server is doable and probably the best approach.

IMHO, one only needs one moodle server ... the one on the internet.   Moodle can be set up so that everyone has to login to it first to see any courses.  And the courses themselves can be hidden (thus one can develop all they like) and when ready for use, un-hidden for students to access.

My 2 cents of course ... am almost certain a 'defender of open source on Windows anything' might have a different 'opinion'!   How about it Windows 'fans'?  Help Filip out! smile

'SoS', Ken


In reply to Ken Task

Re: Installing moodle on a home PC then transfer to server

by Diskreet Baric -
I am developing the site, I was asked by someone to make a moodle site for a course they would like to teach with question banks so they can give them to students. I planned on using the Uni server to add another domain and transfer my PC moodle to there and use it.
In reply to Diskreet Baric

Re: Installing moodle on a home PC then transfer to server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Filip, what I would do is to get your "server" moodle up and running, with the same set up as your PC Moodle, including theme and plugins. Then, you export the PC-Moodle database and import into server-Moodle database. Next, "zip" or "tar" your PC-Moodle moodledata folder, and un-tar it in your server-Moodle.

That's about it. Of course, there are a few more things that do, but you might already know these.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Installing moodle on a home PC then transfer to server

by Diskreet Baric -
So the server I now have on my PC that I used to develop can be transfered to the server machine? I just zip it and bring it to the machine?
In reply to Diskreet Baric

Re: Installing moodle on a home PC then transfer to server

by James Steerpike -
Not quite. What Rick is saying export the Moodle setup and data. You would need to import it into a server already running Moodle.
I would approach your problem by installing directly on to a cloud LAMP server. You want to do this anyway and a windows install is not going to help you much when you install a LAMP. If you want to develop courses while you are getting the server up and running, use MoodleCloud. To me setting up a PC server is double work.
Average of ratings: Useful (1)
In reply to Diskreet Baric

Re: Installing moodle on a home PC then transfer to server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
No, you follow the Moodle docs to essentially migrate your moodle.

I prefer to make sure that I have a working version of Moodle on a server, first. If you can't get a new install of Moodle working on your server, you will certainly have trouble moving a Moodle.

If you happen to have Moodle 3.8 on your PC, then install the same version of Moodle 3.8 on your server. If you have any plugins installed on your PC, then install these plugins on your server.

Your server does not need data in it, but I recommend that it match what you have on your PC, as closely as possible.

After the server looks and works well, then what I would do is to "tar" or "zip" my PCs moodledata folder and move it to my server, delete the moodledata folder on my server, and unzip/untar the PC moodledata file on the server. You have to make sure that you unzip it to exactly the same place, and with the same "rights."

Likewise, "dump" your PC's database. Move the dump file to your server. Delete all tables on your server's moodle, and import the tables from your "dump."

You need to know a bit of UNIX to do this and have access to the command line (terminal.) Sure, one might have success with other tools, but you are making life harder for yourself.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Installing moodle on a home PC then transfer to server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
As a follow up, I do want to mention that I regularly (like about once a week) go the opposite direction. I move my data from my "production" Moodle to my local (Mac) Moodle. I do this for two reasons: 1) A kind of extra "back-up" of my production Moodle, although I do make backups every night that are then on my server, and 2) So that I can experiment with my "real" course data.

I have a small Moodle, so the moodledata "tarred" file is 7GB, and the database is around 3GB.

But, when I was preparing to install a fresh copy of Moodle 3.0 on my server, I actually did all the prep on my MAMP copy, then moved this to my server (which became my first production Moodle 3.0.)

Quite often, when I am working with the question bank, for example importing or developing new questions, I work in my MAMP (Mac) sandbox, then eventually move these questions to my product.
Average of ratings: Useful (1)
In reply to Rick Jerz

Re: Installing moodle on a home PC then transfer to server

by Danijela Grahovac -

Hi,

I have a feature on my hosting server to let the tech team to transfer my site (from my mac) to the server. It is free and I am willing to let them do that for me... when I made a request they are asking me for :

"- you have to remove the current Moodle application (which I installed - one click option) and then to upload the files and the database from your computer.
Once you have done this, we will proceed and configure your Moodle application."

So, which files to send them? (note that I build my site on Mac with MAMP).

by reading your post above, I am not sure that they will be able to do that (I have some extra plugins installed...)

Thanks,

Danijela



In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
It depends on what you want to upload. For example, you could upload the entire home PC moodle, a course, or a question bank. Maybe more (but these three are my most common.) You should probably explain more about what you seek.
In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

@Danijela Grahovac

Well, 'they' are telling you in-correctly - almost - but not all.  No mention of moodledata directory which is 1/3rd of a moodle app.  Code + DB dump (sql file) + moodledata.

You can make an SQL dump of DB via phpMyAdmin that comes with MAMP.  Save the .sql file to Desktop.  MAMP has to be running.

For archiving code + moodledata ... probably best to use Terminal/command line.  MAMP doesn't need to be running.

MAMP is in /Applications/MAMP/

your moodledata is in 'data' folder of MAMP.

To archive data, while in /Applications/MAMP/ issue this command:

tar -cvf ~/Desktop/moodledata.tar ./data/

To archive code, while in /Applications/MAMP/ issue this command:

tar -cvf ~/Desktop/moodlecode.tar ./htdocs/

When those finish, you should see both .tar files on Desktop.

Send them the .tar files + your .sql dump.

'They' should know what to do with them! ;)

Good luck!

'SoS', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Installing moodle on a home PC then transfer to server

by Danijela Grahovac -
Thank you Ken!! Your instructions are super easy to follow, and I sent all three files. I will let you know what "they" did smile

Thanks!
Danijela
In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

@Danijela Grahovac

Good to hear.  Feel free to rate the posting with 'super easy to follow' directions as 'Useful'!

Gotta keep up with the likes of other 'contributors' in this thread! smile

'SoS', Ken

In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

Added 'value' ...

@Danijela Grahovac

You could have transferred those .tar files + the sql file to your server
via a shell script on your desktop.

Script name: scp2server

From ~Desktop

nano scp2server [ENTER]

Contents of scp2server script:

scp ./*.sql ./*.tar username@ipaddressofserver:/path/to/user/home/directory

where
username = your username/login
ipaddressofserver = your server's IP address
:/path/to/user/home/directory = replace paths ... include the ':' in front.

Save file.  CTRL X and save

Make scp2server executable:

chmod u+x scp2server [ENTER]

To run, from Desktop, double click the icon for script.
Script should exit when finished.

Super Easy?

'SoS', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Installing moodle on a home PC then transfer to server

by Danijela Grahovac -
Hi Ken,
my site is up and running , so everything went well. Now I would like to know what 'they' did to make it happen.
If you have some time, can you give us your great easy to follow instructions for uploading prepared files onto server. In my particular case, I have an access to one click installation of the Moodle, I can upload .tar files+.sql file easy and then what?
Thank you !
Danijela
In reply to Ken Task

Re: Installing moodle on a home PC then transfer to server

by Danijela Grahovac -
Hi all,
I have another problem. Raw SCSS is not working... The tech who installed the moodle on the server wrote this:
"The issue is caused due to missing font files in your mooodle datastore directory. You application is attempting to load data from moodle38/theme/font.php/boost/core/1584795424/, but there is no such folder on the server.

If yo can obtain a new backup of the datastore folder, we can attempt to restore in once again in order to fix the missing content."
When I look into files on the server Moodle38 folder is empty and Moodle38-2019.... is not.See attached picture.
The code that is not working:
body {font-family: apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";}
body#page-mod-quiz-review #mod_quiz_navblock .othernav a,
body#page-mod-quiz-review .submitbtns a {
display: none;
}
body#page-mod-quiz-review .submitbtns a.arrow_link {
display: inline;
}
Thanks!
Danijela

Attachment Screen Shot 2020-04-21 at 8.39.07 AM.png
In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

When you transferred moodledata it was the entire directory ... which is what I suggested to you not knowing anything about your new hosting environment NOR the persons behind that.  moodledata contained cached directories ... moodledata/cache and moodledata/localcache/.

Suggest manually removing the contents of ... that's contents of ... moodedata/cache/ and moodledata/localcache/   Has been safe to do in the past as moodle automagically rebuilds everything in those directories as moodle is used and when cron jobs/task call for refreshing caches.

As far as me telling you what they did ... huh?  What?  Mind telling me how am supposed to do that?  No Vulcan Mind Meld possible here! :|

'SoS', Ken



In reply to Ken Task

Re: Installing moodle on a home PC then transfer to server

by Danijela Grahovac -
Hi Ken,
I know what you are talking about... I am sorry that I didn't do it by myself - at least I would know what steps I took...
I don't know if this will help, SiteGround is the hosting and Advanced Tech support is doing this.
In a mean time they did this *see picture (but my code is still not working):
In reply to Danijela Grahovac

Re: Installing moodle on a home PC then transfer to server

by Ken Task -
Picture of Particularly helpful Moodlers

Hmmmm ... in folder I see called 'moodle38' is what appears to be what is normally in moodledata - and dupes ... cache, cache1, and cachebak?

I see a domain directory and htdocs ... which, If I am not mistaken, is customer's domain 'document root' ... where moodle code would reside.

IF moodle code is located there in htdocs, then the config.php file for Moodle probably needs checking for correct info ... paths, domain, etc.

Siteground???!!!???  IF the domain name I see in pic is correct (gmfmtest.ca) in a dig DNS check shows an IP address that appears to belong to Google Cloud!

A curl test of https://yourdomain/ (no moodle38) appears to be where there is a forwarder that points to /moodle38/

A curl test of https://yourdomain/moodle38/ returns 404 ... not found ... from nginx.

???? https://www.keycdn.com/support/404-not-found-nginx ?????

Soooooo .... I dunno!

'SoS', Ken