Score:0

Moodle Migration to new server

kz flag

I have been running a moodle server in aws. Recently the server became not accessible through ssh or http protocols. On trying several things I had to start anew server. The storage of old server is accessible through aws.

  • Old Server configurations:

OS = Ubuntu 18.04

Moodle version = 3.9

  • New Server configurations:

OS = Ubuntu 20.04

Moodle version = 3.10

Is there any method to migrate the data of old moodle to new server? The old server storage is connected as a secondary drive to new server.

Related Information: It is not possible to run any commands on the old server. It is not accessible as a sever over network. This is why I had to start a new server. Even though the storage from old server can be attached as a non-root drive in the new server and the old servers moodle directory files are accessible. The migration process in the moodle documentation needs access to both servers over ssh.

Update1

Found the sql database location in old moodle at /newvolume/var/lib/mysql. There is a file in the name for the database created for old moodle. How to backup from that file to new server?

Update2

By copying the old databse file to mysql directory results in this error. enter image description here

djdomi avatar
za flag
[did you read the manual?](https://docs.moodle.org/311/en/Moodle_migration)
Praveen avatar
kz flag
yes, for that both server access should be there, old sever is not accessible as such, but its storage can be connected to the new server as a secondary drive, cannot boot from it, only files are accessible
Praveen avatar
kz flag
It is not possible to run any commands on the old server, only its files are accessible to the new server
jp flag
Do not try to move and upgrade Moodle at the same time. Just copy the files for Moodle 3.9 and restore the SQL database from backups. After you got it working on the new server you could continue with the upgrade.
Praveen avatar
kz flag
@EsaJokinen How to restore the SQL database? I don't remember taking backups.
Praveen avatar
kz flag
@EsaJokinen I removed new version of moodle and copied the old code and data directory to the new server. How to proceed with the database. The site loads to installation script now.
jp flag
If you don't have the SQL dumps, you could try copying the `/var/lib/mysql/` from the old server. Some repairing of the databases might be required. Please remember to setup an automated backup system for the new server!
Praveen avatar
kz flag
@EsaJokinen I am getting the error as in Update 2
jp flag
Unfortunately it's not that easy to recover a a single database. Instead, copy the entire `/var/lib/mysql/ ` to a new MySQL installation and perform sqldump from there. Then you can import the database from the dump. This is the price you must pay for not having a proper backup plan.
Praveen avatar
kz flag
@EsaJokinen I copied all the files, how to perform sqldump
jp flag
This is a site for professionals helping each other with problems that persist after putting some reasonable effort to fix them by themselves. If you can't create an SQL dump (or figure out how to do such basic tasks) yourself, then maybe you shouldn't administrate the servers by yourself but hire a professional.
Praveen avatar
kz flag
@EsaJokinen Ok, thanks for your time.
djdomi avatar
za flag
that's why this site is for business purposes only, everything else may be asked on superuser.com, however it is possible with rsync to move the old to a new database server but it needs either some knowledge or Google skills...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.