Moving tutor based Open edX Maple from server 1 to server 2 Mysql Errors

Hi friends,
As this documentation (Making backups and migrating data — Tutor documentation) I moved my old server’s data into new one, but it gives me errors how can I solv this problem?.

Logs :

lms_1 |
lms_1 | Traceback (most recent call last):
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/db/backends/base/base.py”, line 219, in ensure_connection
lms_1 | self.connect()
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/utils/asyncio.py”, line 33, in inner
lms_1 | return func(*args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/db/backends/base/base.py”, line 200, in connect
lms_1 | self.connection = self.get_new_connection(conn_params)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/utils/asyncio.py”, line 33, in inner
lms_1 | return func(*args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py”, line 234, in get_new_connection
lms_1 | connection = Database.connect(**conn_params)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/MySQLdb/init.py”, line 130, in Connect
lms_1 | return Connection(*args, **kwargs)
lms_1 | File “/openedx/venv/lib/python3.8/site-packages/MySQLdb/connections.py”, line 185, in init
lms_1 | super().init(*args, **kwargs2)
lms_1 | MySQLdb._exceptions.OperationalError: (2005, “Unknown MySQL server host ‘mysql’ (-3)”)
lms_1 |
lms_1 | The above exception was the direct cause of the following exception:

2022-09-30T11:35:00.089191621Z 2022-09-30T11:35:00.089092Z 0 [Note] Shutting down plugin ‘partition’
2022-09-30T11:35:00.089319112Z 2022-09-30T11:35:00.089114Z 0 [Note] Shutting down plugin ‘BLACKHOLE’
2022-09-30T11:35:00.089332660Z 2022-09-30T11:35:00.089124Z 0 [Note] Shutting down plugin ‘ARCHIVE’
2022-09-30T11:35:00.089340746Z 2022-09-30T11:35:00.089128Z 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2022-09-30T11:35:00.089348452Z 2022-09-30T11:35:00.089208Z 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2022-09-30T11:35:00.089356091Z 2022-09-30T11:35:00.089214Z 0 [Note] Shutting down plugin ‘MyISAM’
2022-09-30T11:35:00.089509951Z 2022-09-30T11:35:00.089243Z 0 [Note] Shutting down plugin ‘INNODB_SYS_VIRTUAL’
2022-09-30T11:35:00.089531280Z 2022-09-30T11:35:00.089259Z 0 [Note] Shutting down plugin ‘INNODB_SYS_DATAFILES’
2022-09-30T11:35:00.089539644Z 2022-09-30T11:35:00.089265Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES’
2022-09-30T11:35:00.089547605Z 2022-09-30T11:35:00.089268Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS’
2022-09-30T11:35:00.089555421Z 2022-09-30T11:35:00.089270Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN’
2022-09-30T11:35:00.089562990Z 2022-09-30T11:35:00.089272Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
2022-09-30T11:35:00.089571198Z 2022-09-30T11:35:00.089274Z 0 [Note] Shutting down plugin ‘INNODB_SYS_COLUMNS’
2022-09-30T11:35:00.089579133Z 2022-09-30T11:35:00.089276Z 0 [Note] Shutting down plugin ‘INNODB_SYS_INDEXES’
2022-09-30T11:35:00.089587283Z 2022-09-30T11:35:00.089277Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS’
2022-09-30T11:35:00.089595130Z 2022-09-30T11:35:00.089279Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLES’
2022-09-30T11:35:00.089602834Z 2022-09-30T11:35:00.089281Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE’
2022-09-30T11:35:00.089610626Z 2022-09-30T11:35:00.089283Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_CACHE’
2022-09-30T11:35:00.089618292Z 2022-09-30T11:35:00.089285Z 0 [Note] Shutting down plugin ‘INNODB_FT_CONFIG’
2022-09-30T11:35:00.089625846Z 2022-09-30T11:35:00.089287Z 0 [Note] Shutting down plugin ‘INNODB_FT_BEING_DELETED’
2022-09-30T11:35:00.089634747Z 2022-09-30T11:35:00.089289Z 0 [Note] Shutting down plugin ‘INNODB_FT_DELETED’
2022-09-30T11:35:00.089642817Z 2022-09-30T11:35:00.089290Z 0 [Note] Shutting down plugin ‘INNODB_FT_DEFAULT_STOPWORD’
2022-09-30T11:35:00.089650956Z 2022-09-30T11:35:00.089292Z 0 [Note] Shutting down plugin ‘INNODB_METRICS’
2022-09-30T11:35:00.089658979Z 2022-09-30T11:35:00.089294Z 0 [Note] Shutting down plugin ‘INNODB_TEMP_TABLE_INFO’
2022-09-30T11:35:00.089666830Z 2022-09-30T11:35:00.089296Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_POOL_STATS’
2022-09-30T11:35:00.089674732Z 2022-09-30T11:35:00.089298Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE_LRU’
2022-09-30T11:35:00.089682426Z 2022-09-30T11:35:00.089300Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE’
2022-09-30T11:35:00.089690016Z 2022-09-30T11:35:00.089301Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX_RESET’
2022-09-30T11:35:00.089698105Z 2022-09-30T11:35:00.089303Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX’
2022-09-30T11:35:00.089705985Z 2022-09-30T11:35:00.089321Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM_RESET’
2022-09-30T11:35:00.089714028Z 2022-09-30T11:35:00.089326Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM’
2022-09-30T11:35:00.089723530Z 2022-09-30T11:35:00.089329Z 0 [Note] Shutting down plugin ‘INNODB_CMP_RESET’
2022-09-30T11:35:00.089731262Z 2022-09-30T11:35:00.089332Z 0 [Note] Shutting down plugin ‘INNODB_CMP’
2022-09-30T11:35:00.089738880Z 2022-09-30T11:35:00.089334Z 0 [Note] Shutting down plugin ‘INNODB_LOCK_WAITS’
2022-09-30T11:35:00.089768837Z 2022-09-30T11:35:00.089336Z 0 [Note] Shutting down plugin ‘INNODB_LOCKS’
2022-09-30T11:35:00.089777152Z 2022-09-30T11:35:00.089338Z 0 [Note] Shutting down plugin ‘INNODB_TRX’
2022-09-30T11:35:00.089785291Z 2022-09-30T11:35:00.089340Z 0 [Note] Shutting down plugin ‘InnoDB’
2022-09-30T11:35:00.089793134Z 2022-09-30T11:35:00.089436Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-09-30T11:35:00.089803770Z 2022-09-30T11:35:00.089667Z 0 [Note] InnoDB: Starting shutdown…
2022-09-30T11:35:00.190764945Z 2022-09-30T11:35:00.190181Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-09-30T11:35:00.191220536Z 2022-09-30T11:35:00.191046Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 220930 11:35:00
2022-09-30T11:35:01.705242749Z 2022-09-30T11:35:01.704981Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1210284
2022-09-30T11:35:01.707565011Z 2022-09-30T11:35:01.707357Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2022-09-30T11:35:01.707609401Z 2022-09-30T11:35:01.707391Z 0 [Note] Shutting down plugin ‘MEMORY’
2022-09-30T11:35:01.707620204Z 2022-09-30T11:35:01.707397Z 0 [Note] Shutting down plugin ‘CSV’
2022-09-30T11:35:01.707628686Z 2022-09-30T11:35:01.707401Z 0 [Note] Shutting down plugin ‘sha256_password’
2022-09-30T11:35:01.707636711Z 2022-09-30T11:35:01.707403Z 0 [Note] Shutting down plugin ‘mysql_native_password’
2022-09-30T11:35:01.707673403Z 2022-09-30T11:35:01.707596Z 0 [Note] Shutting down plugin ‘binlog’
2022-09-30T11:35:01.709384554Z 2022-09-30T11:35:01.709228Z 0 [Note] mysqld: Shutdown complete

Perhaps your MySQL server is not running. Can you use docker container ls to see if mysql is currently running?

You can also try deleting the entire Tutor data directory (make sure you have a copy of the backup somewhere first), then run tutor and make sure it’s working in general, then shut it down, then replace it with your backup, then try again. It may provide an easier way to debug if you first focus on the “get tutor working” workflow which is very well documented and has lots of other questions and answers on the forum.

@braden Thank you much for your replying,

I have tested the opinion you said,

I deleted data directory (keeping the backup) and run tutor but it has no use it does not worked for me.

Same issue? Try also deleting all your docker containers (on the new machine), assuming you have no important data in them. Then run tutor local quickstart and if it doesn’t work, try providing us with more details as recommended on Troubleshooting — Tutor documentation

@braden hank you much for response!,

I have tried no any mysql issues with a new tutor version,

But while backuping the old data to new server it thrown a mysql error :confused:

@braden I inspect to mysql container It says :

  • 2022-10-03 17:55:58+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.35-1debian10 started.
    2022-10-03T17:55:58.705736Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2022-10-03T17:55:58.707448Z 0 [Note] mysqld (mysqld 5.7.35) starting as process 1 …
    2022-10-03T17:55:58.709979Z 0 [Note] InnoDB: PUNCH HOLE support available
    2022-10-03T17:55:58.709997Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2022-10-03T17:55:58.709999Z 0 [Note] InnoDB: Uses event mutexes
    2022-10-03T17:55:58.710001Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
    2022-10-03T17:55:58.710002Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
    2022-10-03T17:55:58.710004Z 0 [Note] InnoDB: Using Linux native AIO
    2022-10-03T17:55:58.710219Z 0 [Note] InnoDB: Number of pools: 1
    2022-10-03T17:55:58.710326Z 0 [Note] InnoDB: Using CPU crc32 instructions
    2022-10-03T17:55:58.711959Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
    2022-10-03T17:55:58.719503Z 0 [Note] InnoDB: Completed initialization of buffer pool
    2022-10-03T17:55:58.721898Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
    2022-10-03T17:55:58.733567Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
    2022-10-03T17:55:58.741858Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
    2022-10-03T17:55:58.741913Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
    2022-10-03T17:55:58.775537Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
    2022-10-03T17:55:58.776147Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
    2022-10-03T17:55:58.776162Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
    2022-10-03T17:55:58.776473Z 0 [Note] InnoDB: Waiting for purge to start
    2022-10-03T17:55:58.826734Z 0 [Note] InnoDB: 5.7.35 started; log sequence number 1224860
    2022-10-03T17:55:58.827107Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
    2022-10-03T17:55:58.827521Z 0 [Note] InnoDB: Buffer pool(s) load completed at 221003 17:55:58
    2022-10-03T17:55:58.827902Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
    mysqld: Table ‘mysql.plugin’ doesn’t exist
    2022-10-03T17:55:58.828183Z 0 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
    2022-10-03T17:55:58.829401Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
    2022-10-03T17:55:58.833300Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
    2022-10-03T17:55:58.833339Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
    2022-10-03T17:55:58.833348Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
    2022-10-03T17:55:58.834538Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
    2022-10-03T17:55:58.834582Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
    2022-10-03T17:55:58.834769Z 0 [Warning] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
    2022-10-03T17:55:58.835798Z 0 [Note] Server hostname (bind-address): ‘*’; port: 3306
    2022-10-03T17:55:58.835840Z 0 [Note] IPv6 is available.
    2022-10-03T17:55:58.835855Z 0 [Note] - ‘::’ resolves to ‘::’;
    2022-10-03T17:55:58.835870Z 0 [Note] Server socket created on IP: ‘::’.
    2022-10-03T17:55:58.838093Z 0 [Warning] Insecure configuration for --pid-file: Location ‘/var/run/mysqld’ in the path is accessible to all OS users. Consider choosing a different directory.
    2022-10-03T17:55:58.838323Z 0 [Warning] Failed to open optimizer cost constant tables

2022-10-03T17:55:58.838522Z 0 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t exist
2022-10-03T17:55:58.838545Z 0 [ERROR] Fatal error: Failed to initialize ACL/grant/time zones structures or failed to remove temporary table files.
2022-10-03T17:55:58.838716Z 0 [ERROR] Aborting

2022-10-03T17:55:58.838765Z 0 [Note] Binlog end
2022-10-03T17:55:58.838834Z 0 [Note] Shutting down plugin ‘ngram’
2022-10-03T17:55:58.838852Z 0 [Note] Shutting down plugin ‘partition’
2022-10-03T17:55:58.838855Z 0 [Note] Shutting down plugin ‘BLACKHOLE’
2022-10-03T17:55:58.838858Z 0 [Note] Shutting down plugin ‘ARCHIVE’
2022-10-03T17:55:58.838861Z 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2022-10-03T17:55:58.838987Z 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2022-10-03T17:55:58.838997Z 0 [Note] Shutting down plugin ‘MyISAM’
2022-10-03T17:55:58.839010Z 0 [Note] Shutting down plugin ‘INNODB_SYS_VIRTUAL’
2022-10-03T17:55:58.839012Z 0 [Note] Shutting down plugin ‘INNODB_SYS_DATAFILES’
2022-10-03T17:55:58.839014Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES’
2022-10-03T17:55:58.839016Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS’
2022-10-03T17:55:58.839018Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN’
2022-10-03T17:55:58.839020Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
2022-10-03T17:55:58.839022Z 0 [Note] Shutting down plugin ‘INNODB_SYS_COLUMNS’
2022-10-03T17:55:58.839024Z 0 [Note] Shutting down plugin ‘INNODB_SYS_INDEXES’
2022-10-03T17:55:58.839026Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS’
2022-10-03T17:55:58.839028Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLES’
2022-10-03T17:55:58.839030Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE’
2022-10-03T17:55:58.839032Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_CACHE’
2022-10-03T17:55:58.839034Z 0 [Note] Shutting down plugin ‘INNODB_FT_CONFIG’
2022-10-03T17:55:58.839036Z 0 [Note] Shutting down plugin ‘INNODB_FT_BEING_DELETED’
2022-10-03T17:55:58.839038Z 0 [Note] Shutting down plugin ‘INNODB_FT_DELETED’
2022-10-03T17:55:58.839040Z 0 [Note] Shutting down plugin ‘INNODB_FT_DEFAULT_STOPWORD’
2022-10-03T17:55:58.839042Z 0 [Note] Shutting down plugin ‘INNODB_METRICS’
2022-10-03T17:55:58.839044Z 0 [Note] Shutting down plugin ‘INNODB_TEMP_TABLE_INFO’
2022-10-03T17:55:58.839045Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_POOL_STATS’
2022-10-03T17:55:58.839047Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE_LRU’
2022-10-03T17:55:58.839050Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE’
2022-10-03T17:55:58.839052Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX_RESET’
2022-10-03T17:55:58.839054Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX’
2022-10-03T17:55:58.839056Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM_RESET’
2022-10-03T17:55:58.839057Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM’
2022-10-03T17:55:58.839059Z 0 [Note] Shutting down plugin ‘INNODB_CMP_RESET’
2022-10-03T17:55:58.839061Z 0 [Note] Shutting down plugin ‘INNODB_CMP’
2022-10-03T17:55:58.839063Z 0 [Note] Shutting down plugin ‘INNODB_LOCK_WAITS’
2022-10-03T17:55:58.839065Z 0 [Note] Shutting down plugin ‘INNODB_LOCKS’
2022-10-03T17:55:58.839067Z 0 [Note] Shutting down plugin ‘INNODB_TRX’
2022-10-03T17:55:58.839069Z 0 [Note] Shutting down plugin ‘InnoDB’
2022-10-03T17:55:58.839232Z 0 [Note] InnoDB: FTS optimize thread exiting.
2022-10-03T17:55:58.839455Z 0 [Note] InnoDB: Starting shutdown…
2022-10-03T17:55:58.939992Z 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-10-03T17:55:58.940523Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 221003 17:55:58
2022-10-03T17:56:00.454682Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1224879
2022-10-03T17:56:00.458701Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2022-10-03T17:56:00.458736Z 0 [Note] Shutting down plugin ‘MEMORY’
2022-10-03T17:56:00.458742Z 0 [Note] Shutting down plugin ‘CSV’
2022-10-03T17:56:00.458746Z 0 [Note] Shutting down plugin ‘sha256_password’
2022-10-03T17:56:00.458748Z 0 [Note] Shutting down plugin ‘mysql_native_password’
2022-10-03T17:56:00.458908Z 0 [Note] Shutting down plugin ‘binlog’
2022-10-03T17:56:00.460393Z 0 [Note] mysqld: Shutdown complete

@Shukurlu Good work - that’s the error we need to see. Your MySQL data is somehow corrupt, possibly because you are using different Tutor/MySQL versions on the new machine vs. the old, so it’s trying to run a new version of MySQL with older MySQL data. Can you check the Tutor version on each?

This thread may be useful.

However, I don’t understand why deleting the Tutor data directory and then running tutor local quickstart didn’t fix this. That should have given you a clean MySQL installation. Perhaps someone with more Tutor debugging experience can help you here.

@braden I am using tutor 13.1.5 and mysql 5.7.35 version for both servers

Then I’m not sure. It seems that your MySQL container on the new machine is somehow corrupt. Perhaps you are not fully deleting it when you’re trying to start with a blank slate. Make sure that all docker volumes, containers, and perhaps even images related to MySQL are fully deleted (google search for how to do this), then try the Tutor quickstart with a completely blank tutor data directory.