0

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

Praveen
  • 103
  • 6
  • [did you read the manual?](https://docs.moodle.org/311/en/Moodle_migration) – djdomi Aug 14 '21 at 13:25
  • 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 Aug 14 '21 at 13:27
  • It is not possible to run any commands on the old server, only its files are accessible to the new server – Praveen Aug 14 '21 at 13:28
  • 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. – Esa Jokinen Aug 14 '21 at 14:42
  • @EsaJokinen How to restore the SQL database? I don't remember taking backups. – Praveen Aug 14 '21 at 15:02
  • @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. – Praveen Aug 14 '21 at 15:04
  • 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! – Esa Jokinen Aug 14 '21 at 16:52
  • @EsaJokinen I am getting the error as in Update 2 – Praveen Aug 14 '21 at 16:58
  • 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. – Esa Jokinen Aug 14 '21 at 17:05
  • @EsaJokinen I copied all the files, how to perform sqldump – Praveen Aug 14 '21 at 17:07
  • 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. – Esa Jokinen Aug 14 '21 at 17:12
  • @EsaJokinen Ok, thanks for your time. – Praveen Aug 14 '21 at 17:14
  • 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... – djdomi Aug 14 '21 at 18:21

0 Answers0