This guide outlines the process of extracting a gzipped backup into a Docker volume and importing the corresponding SQL database.
Restores the wordpress/ folder from backup.tar.gz to the wordpress-12345 volume.
docker run --rm -v $(pwd):/backup -v wordpress-12345:/target busybox \
sh -c "tar -xzf /backup/backup.tar.gz -C /target --strip-components=1 wordpress/"
## 2. Sync Permissions
Ensures the www-data user (UID 33) owns the restored files.
docker run --rm -v wordpress-12345:/target busybox chown -R 33:33 /target
## 3. Import Database
Pipes a SQL dump into the database container using credentials found in wp-config.php.
cat database_dump.sql | docker exec -i db_container_name /usr/bin/mysql -u [USER] -p[PASS] [DB_NAME]