Problems migrating to new host

Problems migrating to new host

by Tina Smith -
Number of replies: 17

I thought it would be super simple...everything else has been...but for some reason Moodle, or maybe it's the database, I'm not sure...aren't cooperating.

I tried just reinstalling fresh and importing the database info...but it is NOT importing! It looks like it may have imported SOME of the tables...I found the users table had imported...but the most important ones...regarding courses. Nothing. 

Not sure what to do now.

(Edited by Howard Miller to fix subject - original submission Tuesday, 26 June 2018, 5:49 AM)

Average of ratings: -
In reply to Tina Smith

Re: Problems migrating to new host

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

Now you've vented big grin ... can you tell us exactly what you did? What instructions did you follow? What version of Moodle is this? What operating system are we talking about? What error messages are you seeing?

When people say (as they often do) that they "installed Moodle and then imported tables" it, unfortunately, shows they have the wrong idea.

It means - at best - you have created and populated a new Moodle database and then overwritten it with a backup, which is pointless. At worst, you have created and populated a new Moodle database and copied a backup over the top, which will result in a broken database. 

All you needed to do was to dump the original database and then import/load the dump to a completely empty database on the new site.  You're probably making it too hard for yourself!!

Make sure you read Moodle_migration, which has a lot more information?

Let us know how you get on big grin

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Thank you so much! I spent pretty much all day yesterday trying to figure this out and I'm so frustrated!

I know it's user error, I just can't figure out what my error is or how to fix this. Oh and that article you mention is no help to me since it's primarily referencing using command line instructions and I have no clue what to do with that, unfortunately. But I would like to learn.

ANYWAY. 

Looking through my history from yesterday, it looks like originally I was looking at the site restore article here on Moodle:  https://docs.moodle.org/24/en/Site_restore
I'm realizing now that that wasn't the right info to use...

I didn't actually get very far with those instructions anyway since I thought I knew what to do and just went to my old host, exported the database via phpMyAdmin, then went to the new database (oh, I forgot to mention that I had used my new host to install Moodle via the one click script install option, so it created the database for me...I just found it and opened the newly created empty database)  and used the import option and tried to import the old into the new. But it didn't work. Didn't import my courses. For some reason it did seem to import my users, though...I don't know what that's about...but doesn't appear to have imported anything else. 

Then I thought, well maybe I should try installing Moodle myself. I uninstalled Moodle and attempted to do that...but got to the info in the Moodle article about how to do that and it was all command line instructions and I got lost again and ended up back at one click Moodle installation.

Looking at my history, I apparently did look at the Moodle migration pages on Moodle.org but those also are full of command line instructions so, again, I had no idea what to do with them and went looking for other instructions.

There ought to be instructions on Moodle.org for command line instructions somewhere for those of us that don't know how to do that. I'd love to learn. I think I'm capable of learning this stuff, I just need step by step instructions...but these instructions assume I know what to do with this info and I don't. And I googled everything I could think of and couldn't even find anything to help me learn. I'm sure it's because I don't even know the terminology to properly google.

Lastly: Moodle is in a subdirectory of my site. I totally forgot about Moodle when I moved my site to a new host. I have already moved the main site, pointed the nameservers to the new server...so I can no longer access Moodle at its previous location except through the old cpanel (which I've yet to shut down, luckily.)  If worse comes to worse, I suppose I can re-point the nameservers back to the old host to be able to log back into Moodle on the old server...I was just hoping to avoid doing that. I don't know if there would be any problems with switching back and forth like that in such a short period.

Also, I assumed since I haven't changed my domain name that there wouldn't be anything else to change...but I'm starting to realize that the change in host might mean that there's info that I'm missing changing somewhere...

So, to recap:
I installed a fresh Moodle install on my new host via a one click script installer....exported the database via the old host phpMyAdmin...attempted to import that backup via the fresh new database on the new host, but nothing imported except users. 

And I never got past that. 

Never got to the Moodledata folder, config file, etc, because I couldn't figure out why the export/import of the database isn't working and I need help figuring out what I'm doing wrong. I know this is just user error because I don't fully understand the process..and I appreciate your help!!

In reply to Tina Smith

Re: Problems migrating to new host

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

Right.... don't ever, ever use one-click installers. They might be fine for "just trying it out" but they will rapidly become the "dog that bit you" if you are using Moodle for real. 

You don't say what operating system you are using, what command line access you have but I assume you have cPanel or similar. I can't stand cPanel but that's just me!

Moodle isn't a desktop application - it's a server application and you absolutely do need to understand a bit about the operating system or hosting you are using. The command line stuff in the instructions is not advanced at all. If you don't know what the commands do, go and find out. Also make sure you understand file ownership and file permissions. It shouldn't take you more than an hour or two to understand these basics (loads of resources online) and it will make your life so much easier. 

I hope I don't sound at all patronising - if you are running live Moodle then you are a server admin whether you like it or not. You need to nail the basics. 

Please, please ask questions but you just seem to be flapping around at the moment. I'm not sure where to start.

Average of ratings: Useful (1)
In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

I replied below to some of the answers I missed...I found out that the servers are Linux based.

So I get it, I am a rookie at this. And I am open to learning. I have no problem googling for info, but the problem I'm running into is that I don't know what I don't know. And "Command Line" type searches brings up nothing helpful in learning what the heck this is even about.

I've already tried all sorts of iterations...I did find one video tutorial that might be helpful, but I'm not entirely sure that it is even on the right topic...because I really don't even know what the heck I'm looking at. I've always just looked for other instructions that give me step by step....go here, click this, do this, click this....I can do that. If it looks like what they say, or if it makes sense to me and I can sort it out.

I just need really good information that don't assume that I know what they are talking about.

And I'm not expecting you to tutor me...but could you maybe give me some key phrases to google to find info? If you actually know of any good websites that break it down for very basic beginners, that would be even more helpful. I'm referring to the command line info right now. 

Like I said, I don't expect y'all here to do the work for me...I google and learn new stuff on the web all the time, especially regards to my websites...and I've tried to do that in regards to this, but I've come up with nothing that helps me because I am obviously not searching right.

I have just moved over to shared hosting on Siteground, if that helps. So yes, cpanel. I cannot tell you what I'd be using for command line because I have zero clue and cannot find anything in their help files...I'm sure I'm using the wrong search terms.

I'd love to learn this stuff and actually know what I'm doing...any pointers you can give me to help me find info would be much appreciated.

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

I just did some more digging via google and FINALLY found what I am hoping is some actual useful info....I found reference to SSH in regards to command line interface...am I on the right track??

If I am, then I found this page on my host (Siteground) that I'm hoping is where I need to go to find info to continue on the right path:  https://www.siteground.com/tutorials/ssh/

Just want to confirm I'm on the right track...and if I'm not...get a course correction. smile

Thanks again!!

In reply to Tina Smith

Re: Problems migrating to new host

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

Yes!  Read and inwardly digest that stuff and it will be greatly to your benefit. If you don't remember anything else, be very sure that you understand file permissions and ownership (and the chmod, chown commands to manipulate them). Some stuff will be specific to how Siteground have set up their hosting so you may find that other tutorials are not directly applicable to you.

cPanel does all the same stuff. It just wraps a web interface around those commands. Once you learn the command line stuff you'll find cPanel incredibly restrictive

If you don't understand anything, just ask. Specific questions always welcome big grin

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Great! And now I'm thinking I will go back and redo all my Wordpress installs too, LOL!! I always did the one click with them too...but I just researched it and it's essentially the same to install WP manually as it is to do an upgrade to Moodle, so I got this, LOL! Don't know why I didn't think to do that years ago!

I'm learning a lot today! LOL!

I'll be back with more questions once I digest all this. And I need to do this fast because my old hosting is overdue and I want to get Moodle moved over and operational before I cancel the old.


Thanks again!!

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Ok I'm slowly starting to get this...but I'm running into some problems.

I followed these instructions closely:  https://www.siteground.com/kb/log-siteground-shared-account-via-ssh-using-putty/

and also used this video to visually walk me through things: 

And I got all the way up to the end where I'm trying to log in via command line...and Putty keeps disconnecting and it won't let me log in. I've followed everything to a T.

The only thing I can think is that I don't have a regular username, I just use my email address to log into my cpanel? Would that be a problem? I don't know a username...do I need to have one for this? If so, I suppose I'd need to contact Siteground about that. If that's not the problem, I'm at a loss as to why it's not letting me log in. 

This is the error message I get the second I hit enter with my username: 

Disconnected: No supported authentication methods available (server sent: publickey)

Through googling this I take it that it has something to do with the key, but I have no idea how to fix it...nothing I've done has worked. Any ideas?

In reply to Tina Smith

Re: Problems migrating to new host

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

Do you have shell access enabled for your account?

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Yes, I followed these instructions carefully:

https://www.siteground.com/tutorials/ssh/enable/


A thought just occurred to me though...I used the wrong IP on another step (later) and it told me I used the wrong IP...I wonder if I used the wrong IP on this step and it’s not set up to notice or tell...

When I did the “what is my IP” thing it gave my public IP and another it didn’t label, which threw me off...because I guess I’ve only ever used my internal IP for LAN gaming and such for my kids, so I just grabbed the one I was familiar with, not realizing that was my internal, and not what I should use for this.  I bet that’s the problem.

I just had a bit of learning about the different IPs and understand them now...I was confused by the difference earlier but I got it now. 


I’ll go try fixing that and see if that solves my problem. Thanks!

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Ok nope. I must have remembered it wrong (not unusual). I just checked and the "allowed IP" is my public IP, so it must have been this was where it told me that I had put the wrong IP...so I apparently did set it up right. So now what?

In reply to Tina Smith

Re: Problems migrating to new host

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

If you're not even getting as far as ssh access then this is one for Siteground's support people. 

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Great minds think alike... Just got off of live chat support. Took all of like 4 min and they told me that it wanted my username, which I didn't have. So they gave it to me and it worked!! WOOT!

So next I'll try the Moodle install from scratch now that I finally have access....more later!

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

UPDATE:  After all that, I didn't even need the command line yet...I followed these instructions: https://docs.moodle.org/32/en/Moodle_migration  and successfully migrated my Moodle site! 


Now I'm trying to figure out why it doesn't appear to be showing any of my images. I'm googling and seeing other people with the same problem...still trying to find a solution that works for me...any ideas? I put my site in maintenance mode for now so it doesn't look weird. But I can take it live again if anyone wants a peek to see if they can help. Otherwise, anyone that knows what this is, let me know!!

I also know that I do need to upgrade...and I wonder if I upgrade will that fix it, or break it more? I don't want to do anything more until I investigate further...

In reply to Tina Smith

Re: Problems migrating to new host

by Tina Smith -

I think I'm going to start a new thread...this one got long and is mostly on a different topic now....

In reply to Howard Miller

Re: Problems migrating to new host

by Tina Smith -

Sorry, just noticed I missed some of your questions...

I upgraded to the latest version of Moodle when I installed fresh. I don't know what the version was that was on the old server... something 3.4, but not sure which one.

When you say operating system, I assume you mean the server's, not my computer's...I googled and found this info on Siteground's website: "All of our servers are Linux based (CentOS) and are configured to work with both Apache and Nginx."

I'm not seeing any error messages, just not seeing info in the database that I know should be there.

In reply to Tina Smith

Re: Problems migrating to new host

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

Hi Tina, I am not the expert, just another Moodle user (with a little experience.)

Your first "sin" is using a one-click installer.  If you cannot install Moodle from scratch, you are going to struggle to migrate your moodle. Sorry, this is just life.

When you have a product like Moodle that can be installed on 50 kinds of servers, 50 kinds of ways, by people with 50 kinds of computer backgrounds, this is (50x50x50) 125,000 sets of one-step instructions. Do you see this issue with your request?  

If I were you, I would provide some basic information to help.

Current version of Moodle, server type (Linux or Windows), hosted, VPS, stand-alone server, etc., , php version, MySQL or other database server, with version numbers.

Future Moodle: same set of information.

If you answer any of these "I don't know.", then you have to go back and "know."  Most people here on Moodle.org are not "mind readers."

Now some of the good and bad news.  I too was like you a few years ago.  I was trying to do the same thing.  You might know more than I do, however.  Yes, it took awhile for me to figure this out. Along the way, I kept careful notes.  Once you figure it out, you will be able to do this in your sleep.

You mention phpMyAdmin.  Well, depending upon your size of Moodle, phpMyAdmin will struggle. The command line is the best way to go.

The more information that you provide, the better people here on Moodle.org can guide you.