Hi
I was wondering if someone could shed some light on the issue im having,
Currently trying to backup my docker-compose wordpress from one host and trying to migrate to another host
But im having difficulty understanding the restore process
docker run --rm --volumes-from deepsight_wordpress_1 -v $(pwd):/backup busybox tar cvfz /backup/wordpress.tar /var/www/html
docker run --rm --volumes-from deepsight_db_1 -v $(pwd):/backup busybox tar cvfz /backup/db.tar /var/lib/mysql
then i sftp copied the db.tar and the wordpress.tar to the other hosts
but on host2 when i try to restore, i get this error, my question is where would i place the tar files on the host2? for the restore which i think that might be the issue
docker run --rm --volumes-from deepsight-wordpress-1 -v $(pwd):/backup busybox bash -c "cd /var/www/html && tar xvf /backup/wordpress.tar --strip 1"
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown.
If you use cvzf while creating the archive, you need to use xvzf to extract the archive (the v is optional in both). The z indicates wether the tar archive is gzip`ed.
Note: you can not create a consistent copy of the mysql volume when the container is running.
Thanks you so much for the reply, you were right adding that command i was able to restore, i did restore it when the container was turned off but now im getting this error
2022-07-12T21:00:07.625446Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:07.626328Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:07.626593Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:07.628919Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:09+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:09+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:10.998124Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:11.026493Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:11.083839Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:11.084105Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:11.084215Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:11.084316Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:11.084387Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:11.084516Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:11.084699Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:11.085127Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:11.085575Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:11.087329Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:13+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:14.632313Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:14.660671Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:14.725685Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:14.726220Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:14.726751Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:14.726865Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:14.726979Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:14.727111Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:14.727281Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:14.727708Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:14.727991Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:14.729382Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:18+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:19+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:19+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:20.743709Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:20.766620Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:20.809700Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:20.809916Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:20.810113Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:20.810234Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:20.810285Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:20.810374Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:20.810545Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:20.810839Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:20.811133Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:20.812282Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:23+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:24+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:24+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:24.913782Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:24.933022Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:24.959148Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:24.959299Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:24.959399Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:24.959565Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:24.959659Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:24.959764Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:24.959992Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:24.960499Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:24.960853Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:24.961720Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:29+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:29+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:30.869503Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:30.896399Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:30.948892Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:30.949063Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:30.949206Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:30.949329Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:30.949442Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:30.949516Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:30.949678Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:30.950639Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:30.950963Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:30.952238Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
2022-07-12 21:00:35+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
2022-07-12 21:00:36+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2022-07-12 21:00:36+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.29-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2022-07-12T21:00:37.090427Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.29) starting as process 1
2022-07-12T21:00:37.118010Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-07-12T21:00:37.158980Z 1 [ERROR] [MY-012209] [InnoDB] Multiple files found for the same tablespace ID:
2022-07-12T21:00:37.159165Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 1 = ['lib/mysql/sys/sys_config.ibd', 'sys/sys_config.ibd']
2022-07-12T21:00:37.159239Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967278 = ['lib/mysql/undo_002', 'undo_002']
2022-07-12T21:00:37.159290Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967279 = ['lib/mysql/undo_001', 'undo_001']
2022-07-12T21:00:37.159354Z 1 [ERROR] [MY-012202] [InnoDB] Tablespace ID: 4294967294 = ['lib/mysql/mysql.ibd', 'mysql.ibd']
2022-07-12T21:00:37.159429Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Failed, retry may succeed.
2022-07-12T21:00:37.159546Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2022-07-12T21:00:37.160276Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2022-07-12T21:00:37.160621Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-07-12T21:00:37.162362Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.29) MySQL Community Server - GPL.
I think it might be because i created first the db container stopped it and restore it not sure whats the correct method?
I understood you first started the mysql container with the volume, which created a database and then your restored the tar into the volume where already a dabase exist. My lack of imagination says this can’t be a clean restore.
You first need to create the empty volume, restore the tar into the volume using a temporary container and then start the final mysql container using the volume.
There is a much easier way to do this. See the docker-compose file used here:
It includes a script to dump the database to an SQL file (I run the script frequently when working on a site). You can bring the whole thing down, and the next time you start it up, it will load the most recent dump. All you have to move is the folder containing the files, the data dumps, the docker-compose.yaml, the .env file and the data export script. Zip up the folder and move it at will.
In fact I keep those folders in Dropbox, and I can bring the site up on any machine with the Dropbox and docker: Windows, Mac, or Linux.
thank you so much for the reply, in case only applies to wordpress, im looking on a way to have a standard to backup containers and restoring in general