I am trying to import a database backup into a craft instance running on Docker, but none of the fields or content from the latest backup are importing.
Here are the steps I took
- I used these default.conf and docker-compose.yml files here to create a local environment with Docker.
- I made a site locally, and backed up the database several times (and so now have a series of backups - see image below)
- I restarted Docker after updating to the latest version, then ran
docker-compose upto relaunch.
- Craft loaded with the initial DB, but none of the fields or content from the latest backup appear (localhost actually returns a Twig runtime err when it encounters the first field.)
It seems the issue lies with my docker-compose.yml (below), but I don't see how to edit this to call the right DB backup. Any help or advice much appreciated!
# docker-compose.yml version: '2.1' services: nginx: image: nginx:alpine ports: - 80:80 depends_on: - craft volumes_from: - craft volumes: - ./default.conf:/etc/nginx/conf.d/default.conf # nginx configuration (see below) - ./assets:/var/www/html/web/assets # For static assets (media, js and css). We don't need PHP for them. craft: image: urbantrout/craftcms:mysql depends_on: - mariadb volumes: - ./backups:/var/www/html/storage/backups - ./templates:/var/www/html/templates # Craft CMS template files - ./modules:/var/www/html/modules # Craft modules directory - ./config/element-api.php:/var/www/html/config/element-api.php # Element API file - we require the plugin below environment: DEPENDENCIES: >- # additional composer packages (must be comma separated) yiisoft/yii2-redis, craftcms/redactor, craftcms/element-api, nystudio107/craft-seomatic CRAFTCMS_EMAIL: XXXXXXXXXXXXX CRAFTCMS_USERNAME: admin CRAFTCMS_PASSWORD: XXXXXXXXXXXXXX CRAFTCMS_SITENAME: Craft CMS Installation CRAFTCMS_LANGUAGE: en-US REDIS_HOST: redis SESSION_DRIVER: redis CACHE_DRIVER: redis DB_SERVER: mariadb DB_NAME: craft DB_USER: craft DB_PASSWORD: secret DB_DATABASE: craft DB_SCHEMA: public DB_DRIVER: mysql DB_PORT: 3306 mariadb: image: mariadb:10.1 environment: MYSQL_ROOT_PASSWORD: root MYSQL_USER: craft MYSQL_PASSWORD: secret MYSQL_DATABASE: craft volumes: # Persistent data - dbdata:/var/lib/mysql redis: image: redis:4-alpine volumes: - redisdata:/data volumes: dbdata: redisdata: