How was the backup-file.sql created in the first place?
How large is the backup-file.sql ... size wise ... from command line:
ls -l backup-file.sql
Was executing mysqldump commands on a DB whose DB server a little messed up and what I was getting for a sql file was really an sql file showing the errors ... not the tables expected for a dump of the entire DB for a moodle that included drop and create commands. So an sql file can fool one.
The source command says to execute SQL statements in an sql file but if that sql file doesn't have (for some reason) create lines like the following example:
CREATE TABLE `mdl_analytics_indicator_calc` (
`id` bigint(10) NOT NULL AUTO_INCREMENT,
`starttime` bigint(10) NOT NULL,
`endtime` bigint(10) NOT NULL,
`contextid` bigint(10) NOT NULL,
`sampleorigin` varchar(255) NOT NULL DEFAULT '',
`sampleid` bigint(10) NOT NULL,
`indicator` varchar(255) NOT NULL DEFAULT '',
`value` decimal(10,2) DEFAULT NULL,
`timecreated` bigint(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `mdl_analindicalc_staendcon_ix` (`starttime`,`endtime`,`contextid`),
KEY `mdl_analindicalc_con_ix` (`contextid`)
KEY `mdl_analindicalc_con_ix` (`contextid`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPRESSED COMMENT='Stored indicator calculations';
/*!40101 SET character_set_client = @saved_cs_client */;
the sql file is doing something else!
Yes, missing tables would matter.
Example ... on a site that doesn't use wiki's, the following tables are present:
mysql> show tables like '%wiki%';
+--------------------------------+
| Tables_in_moodle34ssl (%wiki%) |
+--------------------------------+
| mdl_wiki |
| mdl_wiki_links |
| mdl_wiki_locks |
| mdl_wiki_pages |
| mdl_wiki_subwikis |
| mdl_wiki_synonyms |
| mdl_wiki_versions |
| mdlc_wiki |
| mdlc_wiki_links |
| mdlc_wiki_locks |
| mdlc_wiki_pages |
| mdlc_wiki_subwikis |
| mdlc_wiki_synonyms |
| mdlc_wiki_versions |
+--------------------------------+
14 rows in set (0.01 sec)
If one attempted to use a wiki in Moodle php code, and no tables were present for wiki's don't think Moodle will generate new tables like that on the fly.
Sooo .... ????
'SoS', Ken