Good Migrations: Migrating Moodle to a New Server
HTML-код
- Опубликовано: 15 янв 2023
- This is how to migrate a Moodle (including the wwwroot, moodledata, and SQL database) from one server to another AND changing the URL. For specific parts, please use the timestamps below:
0:13 A question from a viewer
0:35 Overview of what will happen
1:35 Backups - the heart of a good migration
3:24 Introducing the old_server and the new_server
5:30 Finding the path to your Moodle code
7:25 Finding the path to your Moodledata directory
9:30 Finding the database name from config.php
9:55 Putting the moodle on old_server into maintenance mode
12:20 Looking at the files and setting permissions to make copying files easier
15:00 Dumping the SQL database
18:20 A small note on file permissions of the SQL dump
20:04 Setting up the SSH for old_server to connect to new_server
23:05 Setting up SSH keys for password-less login
24:50 Explanation of rsync -- Also, me trying to run rsync from the wrong server (oops!)
29:14 Getting on the right server and running rsync again -- Also troubleshooting destination permissions issues
31:25 rsync finally running (blink and you'll miss it, it's fast)
35:25 START working only on new_server
35:40 gunzipping the SQL dump file
37:15 Making the postgreSQL database on new_server
38:33 Me accidentally pasting a MySQL command where I meant to use a PostgreSQL command -- goes about as well as you might expect
39:19 Troubleshooting the MySQL command
40:20 Creating the PostgreSQL database
41:15 Importing the database contents from the SQL dumpfile
42:42 Editing config.php to add the new server's configuration
44:55 Changing the Nginx Virtualhost file to point to the Moodle
48:50 I surprise myself when it works unexpectedly...
50:50 Simulating a common file permissions issue
53:08 Surprised again when it works without doing find/replace
55:05 Running database find/replace tool to change hardcoded URLs
58:01 Alternative to find/replace tool (using sed -- didn't work, didn't fix LOL)
1:00:50 One last thing... adding a cronjob for the new server
1:03:00 Final checks and final words... Setting file ownership to www-data
I cannot thank you enough for this guide! It took me 3 tries to successfully migrate my server, but it would not have happened without this video. I am subscribed now and look forward to any future content you create around Moodle!
Great to hear! Thanks for the comment and the sub, having a bit of a dry spell at the moment, but hope to be adding more videos next month. Cheers!
Thanks for sharing your knowledge of Moodle and the setup procedures you show.
Glad you enjoyed it! Thanks for your comment.
Excellent video, i installed and migrate moodle several times with a lot of errors and mistakes, this clarifies eveything. Thanks! greetings from Argentina.
Glad it helped. Thanks for the comment :)
Hello there, I have an old Moodle backup ( Moodle directory, SQL Data Base, and Moodledata directory) all of that is in Moodle 2.0 with PHP 5.6 and I want to put it working back with all the newest versions of Moodle, any advice on how can have that done :S
Just made a video answering this:
ruclips.net/video/uwAgONmniqQ/видео.html
Hope that helps!
Great Video... very good information. Could you have just GIT to pull down to the local computer?
Well, you could... but rsync is much faster and more efficient. Also, I can't really recommend making a github repo and storing private data (or user data) in there.
Great Video. do you have any video about migrating moodle from mysql database to moodle psql database? Thanks
Thanks for the great question! I have a video on this topic now. ruclips.net/video/7-VzdQ5WUbA/видео.html
@WiseCat thanks a lot, this is very helpful for me. Thank again for your time and great videos.
Happy to help. Thanks for the inspiration on how to help.
Great video WilseCat and good job there! I am wondering is you have something you can share for a migration from Windows server to a Ubuntu Linux server or that can give proper guidance?
Thank you. Also, sorry but, no, I've never worked with Windows server and so don't really know much about it. I imagine many of the main concepts will be similar, though perhaps with a different interface. Good luck!
@@Wise-Cat I understand and thank you.
Great video. I'm getting stuck at 21:37 my new server is on a virtualbox machine local, my old server is on a digitalocean droplet using windows powershell i can log into either but when i try to log in from my old server to new server i get COnnection timed out, i've tried a few things, disabled ufw and made sure port 22 was open now I'm stuck. Any help would be appreciated.
It sounds like you're trying to login to a local area network (LAN) address from outside on the wide area network (WAN). Basically, unless you setup port forwarding in your router it's unlikely you will be able to do this. The solution? Reverse the login and copy operation. Login to your VirtualBox server and SSH from there to your droplet. With the rsync commands, run rsync from the VirtualBox. That's a lot simpler than setting up port forwarding.
Note that for your VirtualBox server to be accessible from the outside world, you will at some point need to setup port forwarding. But if you just want a local copy you can experiment with, running locally is usually fine.
Good luck!
@@Wise-Cat Thank you, I can't believe you answered so quickly, I'm going to give this a try. You are the best resource on the internet for Moodle Development and Admin, thank you for all the work you do.
Haha, Thanks for the kind words. I usually don't manage such a quick response. Your timing was just extremely lucky. Hope it all worked out for you.
Hello Great video , Picture in my moodle not appear jusr picture there is any notes from you . Thanks again
This can be tricky to troubleshoot. One reason for pictures not displaying that I have seen before is X-sendfile being misconfigured in Nginx. However, there are many possible reasons other than this too.
i am already lost when i saw the Terminal 😒😒
The terminal does look scary at first, but it's not so bad once you get used to it. I made a few videos introducing the Terminal from the very beginning. Perhaps take a look at that playlist and try the terminal again. Good luck!
ruclips.net/p/PLUocP1bKm-DvuXCq4H-V3PUaZB0HIEHAi