Ian
Hi, it‘s no problem for me to answer in a rather old thread. :-)
You need to talk the directory moodle and the directory moodledata from the old MoodleBox to the new one.
sudo su
cd /var/www/
tar czf moodle-moodlebox.tgz moodle
tar czf moodledata-moodlebox.tgz moodledata
Now you can take a program for sftp to download both files to your computer. I am using the program FileZilla for this. Then you need to export the database moodle using adminer.php. Export the database and set "write to file" and gzip. The file moodle.sql.gzip will be downloaded to your computer.
Take a new microSD card for your MoodleBox so the old one will be unchanged until the migration result is okay.
Now you must start the Raspberry Pi with the new card. With the adminer.php you must open the database moodle and delete all tables. Don‘t delete the database itself. When the database is empty you can import the database from the file moodle.sql.gzip on your computer.
Now you must rebuild the exported directories moodle and moodledata. Upload both files moodle-moodlebox.tgz and moodledata-moodlebox.tgz to the user home directory. Now you need to open the terminal.
sudo su
cd /var/www/
cp /home/moodlebox/moodle-moodlebox.tgz .
cp /home/moodlebox/moodledata-moodlebox.tgz .
mv moodle moodle-420
mv moodledata moodledata-420
tar xzf moodle-moodlebox.tgz
tar xzf moodledata-moodlebox.tgz
You will get the two new directories from your old MoodleBox. The owner, the group and the rights of both directories should be correct. Now you are ready to restart the new MoodleBox with the content and all plugins from the old MoodleBox.
Try to restart! I hope it will run without any problem.
Ralf